Skip to content

Commit

Permalink
squash
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco committed Feb 14, 2023
1 parent 5f69ae4 commit 7c34b60
Show file tree
Hide file tree
Showing 18 changed files with 23 additions and 152 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ env:
MYPY_CACHE_VERSION: 4
HA_SHORT_VERSION: 2023.3
DEFAULT_PYTHON: "3.10"
ALL_PYTHON_VERSIONS: "['3.10']"
ALL_PYTHON_VERSIONS: "['3.10', '3.11']"
# 10.3 is the oldest supported version
# - 10.3.32 is the version currently shipped with Synology (as of 17 Feb 2022)
# 10.6 is the current long-term-support
Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/aprs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"domain": "aprs",
"name": "APRS",
"codeowners": ["@PhilRW"],
"disabled": "py311-incompat",
"documentation": "https://www.home-assistant.io/integrations/aprs",
"iot_class": "cloud_push",
"loggers": ["aprslib", "geographiclib", "geopy"],
Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/blackbird/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"domain": "blackbird",
"name": "Monoprice Blackbird Matrix Switch",
"codeowners": [],
"disabled": "py311-incompat",
"documentation": "https://www.home-assistant.io/integrations/blackbird",
"iot_class": "local_polling",
"loggers": ["pyblackbird"],
Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/fido/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"domain": "fido",
"name": "Fido",
"codeowners": [],
"disabled": "py311-incompat",
"documentation": "https://www.home-assistant.io/integrations/fido",
"iot_class": "cloud_polling",
"loggers": ["pyfido"],
Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/matter/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"codeowners": ["@home-assistant/matter"],
"config_flow": true,
"dependencies": ["websocket_api"],
"disabled": "py311-incompat",
"documentation": "https://www.home-assistant.io/integrations/matter",
"iot_class": "local_push",
"requirements": ["python-matter-server==2.0.2"]
Expand Down
8 changes: 5 additions & 3 deletions homeassistant/components/netatmo/netatmo_entity_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@ def async_update_callback(self) -> None:
@property
def device_info(self) -> DeviceInfo:
"""Return the device info for the sensor."""
manufacturer, model = DEVICE_DESCRIPTION_MAP[
getattr(NetatmoDeviceType, self._model)
]
if "." in self._model:
netatmo_device = NetatmoDeviceType(self._model.partition(".")[2])
else:
netatmo_device = getattr(NetatmoDeviceType, self._model)
manufacturer, model = DEVICE_DESCRIPTION_MAP[netatmo_device]
return DeviceInfo(
configuration_url=self._config_url,
identifiers={(DOMAIN, self._id)},
Expand Down
51 changes: 0 additions & 51 deletions homeassistant/components/profiler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from .const import DOMAIN

SERVICE_START = "start"
SERVICE_MEMORY = "memory"
SERVICE_START_LOG_OBJECTS = "start_log_objects"
SERVICE_STOP_LOG_OBJECTS = "stop_log_objects"
SERVICE_DUMP_LOG_OBJECTS = "dump_log_objects"
Expand All @@ -32,7 +31,6 @@

SERVICES = (
SERVICE_START,
SERVICE_MEMORY,
SERVICE_START_LOG_OBJECTS,
SERVICE_STOP_LOG_OBJECTS,
SERVICE_DUMP_LOG_OBJECTS,
Expand All @@ -58,10 +56,6 @@ async def _async_run_profile(call: ServiceCall) -> None:
async with lock:
await _async_generate_profile(hass, call)

async def _async_run_memory_profile(call: ServiceCall) -> None:
async with lock:
await _async_generate_memory_profile(hass, call)

async def _async_start_log_objects(call: ServiceCall) -> None:
if LOG_INTERVAL_SUB in domain_data:
domain_data[LOG_INTERVAL_SUB]()
Expand Down Expand Up @@ -162,16 +156,6 @@ async def _async_dump_scheduled(call: ServiceCall) -> None:
),
)

async_register_admin_service(
hass,
DOMAIN,
SERVICE_MEMORY,
_async_run_memory_profile,
schema=vol.Schema(
{vol.Optional(CONF_SECONDS, default=60.0): vol.Coerce(float)}
),
)

async_register_admin_service(
hass,
DOMAIN,
Expand Down Expand Up @@ -265,37 +249,6 @@ async def _async_generate_profile(hass: HomeAssistant, call: ServiceCall):
)


async def _async_generate_memory_profile(hass: HomeAssistant, call: ServiceCall):
# Imports deferred to avoid loading modules
# in memory since usually only one part of this
# integration is used at a time
from guppy import hpy # pylint: disable=import-outside-toplevel

start_time = int(time.time() * 1000000)
persistent_notification.async_create(
hass,
(
"The memory profile has started. This notification will be updated when it"
" is complete."
),
title="Profile Started",
notification_id=f"memory_profiler_{start_time}",
)
heap_profiler = hpy()
heap_profiler.setref()
await asyncio.sleep(float(call.data[CONF_SECONDS]))
heap = heap_profiler.heap()

heap_path = hass.config.path(f"heap_profile.{start_time}.hpy")
await hass.async_add_executor_job(_write_memory_profile, heap, heap_path)
persistent_notification.async_create(
hass,
f"Wrote heapy memory profile to {heap_path}",
title="Profile Complete",
notification_id=f"memory_profiler_{start_time}",
)


def _write_profile(profiler, cprofile_path, callgrind_path):
# Imports deferred to avoid loading modules
# in memory since usually only one part of this
Expand All @@ -307,10 +260,6 @@ def _write_profile(profiler, cprofile_path, callgrind_path):
convert(profiler.getstats(), callgrind_path)


def _write_memory_profile(heap, heap_path):
heap.byrcs.dump(heap_path)


def _log_objects(*_):
# Imports deferred to avoid loading modules
# in memory since usually only one part of this
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/profiler/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/profiler",
"quality_scale": "internal",
"requirements": ["pyprof2calltree==1.4.5", "guppy3==3.1.2", "objgraph==3.5.0"]
"requirements": ["pyprof2calltree==1.4.5", "objgraph==3.5.0"]
}
13 changes: 0 additions & 13 deletions homeassistant/components/profiler/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,6 @@ start:
min: 1
max: 3600
unit_of_measurement: seconds
memory:
name: Memory
description: Start the Memory Profiler
fields:
seconds:
name: Seconds
description: The number of seconds to run the memory profiler.
default: 60.0
selector:
number:
min: 1
max: 3600
unit_of_measurement: seconds
start_log_objects:
name: Start log objects
description: Start logging growth of objects in memory
Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/rflink/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"domain": "rflink",
"name": "RFLink",
"codeowners": ["@javicalle"],
"disabled": "py311-incompat",
"documentation": "https://www.home-assistant.io/integrations/rflink",
"iot_class": "assumed_state",
"loggers": ["rflink"],
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/unifiprotect/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"iot_class": "local_push",
"loggers": ["pyunifiprotect", "unifi_discovery"],
"quality_scale": "platinum",
"requirements": ["pyunifiprotect==4.6.2", "unifi-discovery==1.1.7"],
"requirements": ["pyunifiprotect==4.7.0", "unifi-discovery==1.1.7"],
"ssdp": [
{
"manufacturer": "Ubiquiti Networks",
Expand Down
6 changes: 3 additions & 3 deletions homeassistant/package_constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ iso4217!=1.10.20220401
# Pandas 1.4.4 has issues with wheels om armhf + Py3.10
pandas==1.4.3

# uamqp 1.6.1, has 1 failing test during built on armv7/armhf
uamqp==1.6.0

# Matplotlib 3.6.2 has issues building wheels on armhf/armv7
# We need at least >=2.1.0 (tensorflow integration -> pycocotools)
matplotlib==3.6.1

# pyOpenSSL 23.0.0 or later required to avoid import errors when
# cryptography 39.0.0 is installed with botocore
pyOpenSSL>=23.0.0

# cmake is required to build uamqp
cmake==3.25.2
23 changes: 1 addition & 22 deletions requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,6 @@ apcaccess==0.0.13
# homeassistant.components.apprise
apprise==1.2.1

# homeassistant.components.aprs
aprslib==0.7.0

# homeassistant.components.aqualogic
aqualogic==2.6

Expand Down Expand Up @@ -765,9 +762,6 @@ geniushub-client==0.7.0
# homeassistant.components.geocaching
geocachingapi==0.2.1

# homeassistant.components.aprs
geopy==2.3.0

# homeassistant.components.geo_rss_events
georss_generic_client==0.6

Expand Down Expand Up @@ -848,9 +842,6 @@ gspread==5.5.0
# homeassistant.components.gstreamer
gstreamer-player==1.1.2

# homeassistant.components.profiler
guppy3==3.1.2

# homeassistant.components.iaqualink
h2==4.1.0

Expand Down Expand Up @@ -1521,9 +1512,6 @@ pybalboa==1.0.0
# homeassistant.components.bbox
pybbox==0.0.5-alpha

# homeassistant.components.blackbird
pyblackbird==0.5

# homeassistant.components.bluetooth_tracker
# pybluez==0.22

Expand Down Expand Up @@ -1623,9 +1611,6 @@ pyezviz==0.2.0.9
# homeassistant.components.fibaro
pyfibaro==0.6.6

# homeassistant.components.fido
pyfido==2.1.1

# homeassistant.components.fireservicerota
pyfireservicerota==0.0.43

Expand Down Expand Up @@ -2077,9 +2062,6 @@ python-kasa==0.5.0
# homeassistant.components.lirc
# python-lirc==1.2.3

# homeassistant.components.matter
python-matter-server==2.0.2

# homeassistant.components.xiaomi_miio
python-miio==0.5.12

Expand Down Expand Up @@ -2153,7 +2135,7 @@ pytrafikverket==0.2.3
pyudev==0.23.2

# homeassistant.components.unifiprotect
pyunifiprotect==4.6.2
pyunifiprotect==4.7.0

# homeassistant.components.uptimerobot
pyuptimerobot==22.2.0
Expand Down Expand Up @@ -2242,9 +2224,6 @@ restrictedpython==6.0
# homeassistant.components.idteck_prox
rfk101py==0.0.1

# homeassistant.components.rflink
rflink==0.0.63

# homeassistant.components.ring
ring_doorbell==0.7.2

Expand Down
23 changes: 1 addition & 22 deletions requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,6 @@ apcaccess==0.0.13
# homeassistant.components.apprise
apprise==1.2.1

# homeassistant.components.aprs
aprslib==0.7.0

# homeassistant.components.aranet
aranet4==2.1.3

Expand Down Expand Up @@ -581,9 +578,6 @@ gcal-sync==4.1.2
# homeassistant.components.geocaching
geocachingapi==0.2.1

# homeassistant.components.aprs
geopy==2.3.0

# homeassistant.components.geo_rss_events
georss_generic_client==0.6

Expand Down Expand Up @@ -643,9 +637,6 @@ growattServer==1.3.0
# homeassistant.components.google_sheets
gspread==5.5.0

# homeassistant.components.profiler
guppy3==3.1.2

# homeassistant.components.iaqualink
h2==4.1.0

Expand Down Expand Up @@ -1109,9 +1100,6 @@ pyaussiebb==0.0.15
# homeassistant.components.balboa
pybalboa==1.0.0

# homeassistant.components.blackbird
pyblackbird==0.5

# homeassistant.components.neato
pybotvac==0.0.23

Expand Down Expand Up @@ -1163,9 +1151,6 @@ pyezviz==0.2.0.9
# homeassistant.components.fibaro
pyfibaro==0.6.6

# homeassistant.components.fido
pyfido==2.1.1

# homeassistant.components.fireservicerota
pyfireservicerota==0.0.43

Expand Down Expand Up @@ -1473,9 +1458,6 @@ python-juicenet==1.1.0
# homeassistant.components.tplink
python-kasa==0.5.0

# homeassistant.components.matter
python-matter-server==2.0.2

# homeassistant.components.xiaomi_miio
python-miio==0.5.12

Expand Down Expand Up @@ -1525,7 +1507,7 @@ pytrafikverket==0.2.3
pyudev==0.23.2

# homeassistant.components.unifiprotect
pyunifiprotect==4.6.2
pyunifiprotect==4.7.0

# homeassistant.components.uptimerobot
pyuptimerobot==22.2.0
Expand Down Expand Up @@ -1584,9 +1566,6 @@ reolink-aio==0.4.1
# homeassistant.components.python_script
restrictedpython==6.0

# homeassistant.components.rflink
rflink==0.0.63

# homeassistant.components.ring
ring_doorbell==0.7.2

Expand Down
6 changes: 3 additions & 3 deletions script/gen_requirements_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,16 @@
# Pandas 1.4.4 has issues with wheels om armhf + Py3.10
pandas==1.4.3
# uamqp 1.6.1, has 1 failing test during built on armv7/armhf
uamqp==1.6.0
# Matplotlib 3.6.2 has issues building wheels on armhf/armv7
# We need at least >=2.1.0 (tensorflow integration -> pycocotools)
matplotlib==3.6.1
# pyOpenSSL 23.0.0 or later required to avoid import errors when
# cryptography 39.0.0 is installed with botocore
pyOpenSSL>=23.0.0
# cmake is required to build uamqp
cmake==3.25.2
"""

IGNORE_PRE_COMMIT_HOOK_ID = (
Expand Down
2 changes: 1 addition & 1 deletion tests/components/netatmo/test_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ async def test_service_set_camera_light_invalid_type(hass, config_entry, netatmo
await hass.async_block_till_done()

mock_set_state.assert_not_called()
assert excinfo.value.args == ("NACamera <Hall> does not have a floodlight",)
assert "NACamera <Hall> does not have a floodlight" in excinfo.value.args[0]


async def test_camera_reconnect_webhook(hass, config_entry):
Expand Down
Loading

0 comments on commit 7c34b60

Please sign in to comment.