* Fix stop listener leak in DataUpdateCoordinator
When an integration retries setup it will add a new stop listener
* Skip scheduled refreshes when hass is stopping
* Update homeassistant/helpers/update_coordinator.py
* ensure manual refresh after stop
* Store coordinator at Device
* Use DeviceUpdater to follow config/location changes
* Cleaning up
* Fix unit tests + review changes
* Don't test internals
Some of the compatible hardware sends event signals that wouldn't map
well to entities, e.g. NTP sync notifications, SIP registering
information, or « doorbell button pressed » events with no « return to
rest state » matching event to have a properly behaved binary sensor.
Instead of only monitoring specific events, subscribe to all of them,
and pass them through (in addition to handling them as before if they
correspond to a configured binary sensor).
Also bump python-amcrest to 1.7.2. Digest of the changes:
* The library now passes through the event data instead of just presence of a
"Start" member in in.
* Connection to some devices has been fixed by not throwing the towel on
minor errors.
https://github.com/tchellomello/python-amcrest/compare/1.7.1...1.7.2
* Migrate existing zwave_js entities if endpoint has changed
* better function name
* cleanup code
* return as early as we can
* use defaultdict instead of setdefault
* PR comments
* re-add missing logic
* set defaultdict outside of for loop
* additional cleanup
* parametrize tests
* fix reinterview logic
* test that we skip migration when multiple entities are found
* Update tests/components/zwave_js/test_init.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Added 'mix' system support for Growatt integration
* Changed Growatt "Last Data Update" to a timestamp
* Changed Growatt "Last Data Update" to UTC
* Accepted suggested change for Growatt "Last Data Update"
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Add Hyperion device support.
* Update to the new typing annotations.
* Add device cleanup logic.
* Fixes based on the excellent feedback from emontnemery
* Lazy load zwave_js platforms when the first entity needs to be created
* switch order to make things easier to understand
* await task instead of using wait_for_done callback
* gather tasks
* switch from asyncio.create_task to hass.async_create_task
* unsubscribe from callbacks before unloading platforms
* Clean up as much as possible during entry unload, even if a platform unload fails
* initial configuration options
* first crack at saving the data
* constants
* implement initial options
* make more dynamic
* fix unload and reload of the config entry
* update unload
* percentage to speed_range and get speed state fix
* Update homeassistant/components/mqtt/fan.py
* Update homeassistant/components/mqtt/fan.py
* Update homeassistant/components/mqtt/fan.py
* Update homeassistant/components/mqtt/fan.py
Co-authored-by: J. Nick Koston <nick@koston.org>
The previous iAlarm integration has been removed because it used
webscraping #43010.
Since then, the pyialarm library has been updated to use the iAlarm API
instead.
With this commit I reintroduce the iAlarm integration, leveraging the
new HA config flow.
Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
The openweathermap component retrieves atmospheric pressure from the
openweathermap api and passes it along without checking the units.
The api returns pressure in metric (hPa). If you the use the weather
forecast card on a non-metric home assistant install, you will then
see the pressure reported as something like '1019 inHg', which is an
incorrect combination of metric value and non-metric label.
To fix this, check when retrieving the pressure if this is a metric
system. If not, convert the value to non-metric inHg before sending
it along.
Weirdly, this isn't a problem for temperature, so I suspect temp is
getting converted somewhere else.
* Add source address to Sensor and BinarySensor
* Fix typing
* Review: Always use UTC time in state attributes
* Review: Add missing UTC conversion in sensor
* Prevent ping id allocation conflict with device_tracker
- Solves id conflict resulting unexpected home state
* Update homeassistant/components/ping/device_tracker.py
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Extend media source URL expiry to 12h
closes#46280
After checking out https://github.com/home-assistant/core/pull/48912 I just think why not.
* Update homeassistant/components/cast/media_player.py
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Update Ezviz Component
* Update Ezviz for pylint test
* Update Ezviz component pylint tests
* Update Ezviz component tests
* Update Ezviz Component tests
* Update Ezviz component pylint error
* Fix ezviz component config flow tests
* Update ezviz component
* Update Ezviz component
* Add sensor platforms
* issue with requirements file
* Update binary_sensor to include switches
* Updates to Ezviz sensors
* Removed enum private method.
* Fix switch args
* Update homeassistant/components/ezviz/switch.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* config flow checks login info
* Config_flow now imports ezviz from camera platform
* Update test
* Updated config_flow with unique_id and remove period from logging
* Added two camera services and clarified service descryptions in services.yaml
* Fixed variable name mistake with new service
* Added french integration translation
* Config_flow add camera rtsp credentials as seperate entities, with user step and import step
* rerun hassfest after rebase
* Removed region from legacy config schema, removed logging in camera platform setup that could contain credentials, removed unused constant.
* Regenerate requirements
* Fix tests and add config_flow import config test
* Added addition test to config_flow to test successfull camera entity create.
* Add to tests method to end in create entry, config_flow cleanup, use entry instead of entry.data
* Removed all services, sorted platforms in init file.
* Changed RTSP logging to debug from warning. (Forgot to change this before commit)
* Cleanup typing, change platform order, bump pyezviz version
* Added types to entries, allow creation of main entry if deleted by validating existance of type
* Config_flow doesn't store serial under entry data, camera rtsp read from entry and not stored in hass, removed duplicate abort if unique id from config flow
* Fix test of config_flow
* Update tests/components/ezviz/test_config_flow.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update tests/components/ezviz/test_config_flow.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update tests/components/ezviz/test_config_flow.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Bumped pyezviz api version, added api pyezvizerror exception raised in api (on HTTPError), cleanup unused imports.
* rebase
* cleanup coordinator, bump pyezviz api version, move async_setup_entry to add entry options to camera entries. (order change)
* Added discovery step in config_flow if cameras detected without rtsp config entry
* Reload main integration after addition or completion of camera rtsp config entry
* Add tests for discovery config_flow, added a few other output asserts
* Camera platform call discover flow with hass.async_create_task. Fixes to config_flow for discovery step
* Fix config_flow discovery, add check to legacy yaml camera platform import, move camera private method to camera import step
* Remove not needed check from config_flow import step.
* Cleanup config_flow
* Added config_flow description for discovered camera
* Reordered description in config_flow confim step.
* Added serial to flow_step description for discovered camera, readded camera attributes for rtsp stream url (allows user to check RTSP cred), added local ip and firmware upgade available.
* Bumped pyezviz version and changed region code to region url. (Russia uses a completly different url). PyEzviz adds a Local IP sensor, removed camera entity attributes.
* Add RSTP describe auth check from API to config_flow
* url as vol.in options in Config_flow
* Config_flow changes to discovery step, added exceptions, fixed tests, added rtsp config validate module mock to test disovery confirm step
* Add test for config_flow step user_camera
* Added tests for abort flow
* Extend tests on custom url flow step
* Fix exceptions in config_flow, fix test for discovery import exception test
* Bump pyezviz api version
* Bump api version, added config_flow function to wake hybernating camera before testing credentials, removed "user camera" step from config flow not needed as cameras are discovered.
* Create pyezviz Api instance for config_flow wake hybernating camera, fixed tests and added fixture to mock method
* Added alarm_control_panel with support to arm/disarm all cameras, fixed camera is available attribute (returns 2 if unavailable, 1 if available)
* Skip ignored entities when setup up camera RTSP stream
* Remove alarm_control_panel, add additional config_flow tests
* Cleanup tests, add tests for discovery_step.
* Add test for config_flow rtsp test step1 exceptions
* Removed redundant except from second step in test RTSP method
* All tests to CREATE or ABORT, added step exception for general HTTP error so user can retry in case of trasient network condition
* Ammended tests with output checks for step_id, error, data, create entry method calls.
* bumped ezviz api now rases library exceptions. Config_flow, coordiantor and init raises library exceptions. Updated test sideeffect for library exceptions
* Bump api version, Create mock ezviz cloud account on discovery tests first to allow more complete testing of step.
* Add abort to rtsp verification method if cloud account was deleted and add tests
* Update tests/components/ezviz/__init__.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/ezviz/const.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update tests/components/ezviz/__init__.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/ezviz/camera.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/ezviz/camera.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/ezviz/camera.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/ezviz/camera.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/ezviz/camera.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/ezviz/camera.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Undo config import change to password key for yaml, move hass.data.setdefault to async_setup_entry and remove async_setup
* Fixed tests by removing _patch_async_setup as this was removed from init.
* Update homeassistant/components/ezviz/camera.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/ezviz/camera.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/ezviz/camera.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Changed L67 on camera config to complete suggestion for cleanup
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
AEMET OpenData doesn't clarify if the hourly data timestamp is UTC or not, but
after correctly formatting the town timestamp in ISO format, it is clear that
the timestamp is provided as UTC value.
Therefore, the only values not provided as UTC are the ones related to the
specific daily and hourly forecast values.
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Some systems expose cpu temperatures differently in
psutil. Specifically, running armbian on the Odroid xu4 sbc gives the
following temerature output:
>>> pp.pprint(psutil.sensors_temperatures())
{ 'cpu0-thermal':
[ shwtemp(label='', current=54.0, high=115.0, critical=115.0)],
'cpu1-thermal':
[ shwtemp(label='', current=56.0, high=115.0, critical=115.0)],
'cpu2-thermal':
[ shwtemp(label='', current=58.0, high=115.0, critical=115.0)],
'cpu3-thermal':
[ shwtemp(label='', current=56.0, high=115.0, critical=115.0)],
}
Since the cpu number is embedded inside the name, the current code
can't find it.
To fix this, check both the name and the constructed label for matches
against CPU_SENSOR_PREFIXES, and add the appropriate label
cpu0-thermal in the prefix list.
While this is slightly less efficient that just generating the label
and checking it, it results in easier to understand code.
We plan on matching with _airplay which means we need
to able to limit to specific manufacturers to avoid
generating flows for integrations with the wrong
manufacturer
* raise an exception when event_type exceeds the max length that the recorder supports
* add test
* use max length constant in recorder
* update config entry reloaded service name
* remove exception string function because it's not needed
* increase limit to 64 and revert event name change
* fix test
* assert exception args
* fix test
* add comment about migration