* refactor tests for KNX
- implement KNXTestKit class for convenient setup and assertion of KNX telegrams
- add fixture returning an instance of KNXTestKit with automatic cleanup test
* add tests for expose default attribute
- fix expose edge case not covered by #53046
* use asyncio.Queue instead of AsyncMock.call_args_list
for better readability
* get xknx from Mock instead of hass.data
* fix type annotations
* add injection methods for incoming telegrams
* rest read-response in expose
* Switch to dataclass from dictionary for climacell sensor definitions
* fix post_init
* fix dataclass and add test
* Update homeassistant/components/climacell/sensor.py
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Update homeassistant/components/climacell/const.py
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* simplify logic
* use tuple
* simplify unit of measurement and use class attributes
* Switch from UnitT to str
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Upgrade honeywell from platform to integration
* Add codeowner and run code formatter
* Add sensors for current indoor temp and humidity
* Fix tests and away temp
* Spring cleaning of honeywell tests
* Add config flow to honeywell integration
* Add config flow test
* Tie in honeywell service update
* Simplify config flow and add import
* Remove unnecessary platform schema
* Clean up based on PR comments
* Use new helper method
* Force single device and fix linter errors
* Address PR feedback
* Update translations
* Change string key and remove logger message
* Always add first device
* Fix test assertion
* Put PLATFORM_SCHEMA back
* Skip code coverage check on honeywell init
* add some tests for honeywell
* Make retry async
* Make device private
* Use _attr_ instead of properties
* Code cleanup from PR feedback
* Fix test and cleanup code
* Make description better
Co-authored-by: Matt Zimmerman <mdz@alcor.net>
* Add On/Off as target values for stop cover
Certain ZWave Cover devices use On/Off instead of the more common
Open/Close and Up/Down targets for movement.
Adding On/Off to the targets used to stop the cover during movement.
Fixes issue #51963
* Add test for updated zwave_js stop cover logic
* New mqtt humidifier platform
* Add humidifier platform
* Leave out humidity step
* Use humidity in constant for payload reset
* change TARGET_HUMIDITY_RESET payload name
* _attr_max_humidity not assigned correctly
* _target_humidity_range has a zero base
* align CONF_TARGET_HUMIDITY_MIN and MAX with model
* shorter topics for humidity_range
* Converts float to int from template
* new humidifier abbreviations
* Add common module to support tests
* Add tests
* Addtional testing
* Always require target_humidity_command_topic
* Typo
* use available_modes to align entity model
* use avail_modes not modes to avoid conflict
* typo target_humidity_value_template
* Allign modes and templates with climate platform
* mode_state_template
* target_humidity_state_template
* Typo in platform name
* Remove humidity_range feature and common lib
* Update homeassistant/components/mqtt/humidifier.py
Use vol.In, not regex
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* black
* Update homeassistant/components/mqtt/humidifier.py
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Use round to convert float to target humidity
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* change _attr_unique_id to unique_id and resolve conflict
* add test state updates from the API
* optimizer code test
* fix test
* fix comments and add test device registry
* Initial support for zwave_js device triggers
* lint
* Add node status changed trigger
* comments
* create helper function and simplify trigger logic
* simplify code
* fix exception
* remove unused type ignore
* switch to append to make future changes easier
* make exception consistent
* Add state config schema validation
* comment
* remove 0 from falsy check
* increase test coverage
* typos
* Add central scene and scene activation value notification triggers
* reorder things for readability and enumerate node statuses
* Add support for Basic CC value notifications
* fix schemas since additional fields on triggers aren't very flexible
* pylint
* remove extra logger statement
* fix comment
* dont use get when we know key will be available in dict
* tweak text
* use better schema for required extra fields that are ints
* rename trigger types to make them easier to parse
* fix strings
* missed renaming of one trigger type
* typo
* Fix strings
* reduce complexity
* Use Al's suggestion for strings
* add additional failure test cases
* remove errant logging statement
* make CC required
* raise vol.Invalid when value ID isn't legit to prepare for next PR
* Use helper function
* fix tests
* black
* Add support for Z-Wave JS siren
* Add additional device class to discovery
* fix docstring
* Remove device class specific part of discovery schema
* rename test
* switch to entry.async_on_remove
* Fix logic based on #52971
* Use constants to unblock PR
* Add support to set volume level
* Update homeassistant/components/zwave_js/siren.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Bump pyatv to 0.8.1
* Update apple_tv tests for new create_session location
* Update test_user_adds_unusable_device to try device with no services
pyatv >=0.8.0 considers AirPlay a valid service and no longer fails under the previous conditions.
* Handle dhcp packets without a hostname
- Since some integrations only match on OUI we want to
make sure they still see devices that do not request
a specific hostname
* Update tests/components/dhcp/test_init.py
* Update homeassistant/components/dhcp/__init__.py
Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Franck Nijhof <git@frenck.dev>
* Add siren platform
* add more supported flags and an ability to set siren duration
* tone can be int or string
* fix typing
* fix typehinting
* fix typehints
* implement a proposed approach based on discussion
* Address comments
* fix tests
* Small fix
* Update homeassistant/components/demo/siren.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/demo/siren.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/demo/siren.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/demo/siren.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/demo/siren.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* typing
* use class attributes
* fix naming
* remove device from service description
* Filter out params from turn on service
* fix tests
* fix bugs and tests
* add test
* Combine is_on test with turn on/off/toggle service tests
* Update homeassistant/components/siren/__init__.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* fix filtering of turn_on attributes
* none check
* remove services and attributes for volume level, default duration, and default tone
* Update homeassistant/components/siren/__init__.py
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
* Update homeassistant/components/siren/__init__.py
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
* Update homeassistant/components/siren/__init__.py
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
* import final
* Update homeassistant/components/siren/__init__.py
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
* Fix typing and used TypedDict for service parameters
* remove is_on function
* remove class name redundancy
* remove extra service descriptions
* switch to positive_int
* fix schema for tone
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
* Add transition support to zwave_js lights
* Add transition support to color_switch lights
* simplify and add tests
* fix logic
* add check for color transition to add SUPPORT_TRANSITON supported features
* Use new metadata property
* Use new metadata property
* update tests and device state dump json files
* fix file perms
* update tests and fixtures with new metadata
* update test
* update test
* update tests for color transitions
* check for color tansitions as well
* more tests
* fix color transtions
* remove unneed default
* set add_to_watched_value_ids to false
* set transition default
* properly set default
* update tests
* make sure transition is an int
* suggested changes
* Update homeassistant/components/zwave_js/light.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/zwave_js/light.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/zwave_js/light.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/zwave_js/light.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/zwave_js/light.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* formatting
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Make use of entry id rather than unique id when storing entry in hass data
* Update homeassistant/components/deconz/services.py
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
* Don't create any devices or entities for dead zwave_js nodes
* mark entities for dead nodes as unavailable
* add test
* watch for node status updates
* update tests to handle node status changes as well
* Import track_new_devices and scan_interval from yaml for nmap_tracker
* Import track_new_devices and scan_interval from yaml for nmap_tracker
* Import track_new_devices and scan_interval from yaml for nmap_tracker
* tests
* translate
* tweak
* adjust
* save indent
* pylint
* There are two CONF_SCAN_INTERVAL constants
* adjust name -- there are TWO CONF_SCAN_INTERVAL constants
* remove CONF_SCAN_INTERVAL/CONF_TRACK_NEW from user flow
* assert it does not appear in the user step
* Add quantiles as another Statistics attribute
Quantiles divide states into intervals of equal probability. The
statistics.quantiles() function was added in Python 3.8 and can now
be included in the Statistics integration without new dependencies.
Quantiles can be used in conjunction with other distribution metrics to
create box plots (quartiles) and other graphical resources for
visualizing the distribution of states.
* Add quantiles reference to basic tests
* Add switch platform to Fritz
* Fix tests
* Pylint
* Small fix
* Bump fritzprofiles to fix log level and identifier
* Fix different WiFi networks with same name
* Changed exposed attributes
* Moved to extra_state
* Remove redundant lambda
* Add missing wait
* Removed identifiers
* Update homeassistant/components/fritz/switch.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/fritz/switch.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Add mapping dict
* Device Profile disabled by default
* Heavy cleanup
* Tweak
* Bug fix
* Update homeassistant/components/fritz/switch.py
Co-authored-by: Aaron David Schneider <aaron.schneider@nbi.ku.dk>
* Fix port forward switching + small log improvement
* Cleanup from old approach
* Handle port mapping hot removal (from device)
* Minor fixes
* Typying
* Removed lambda call
* Last missing strict typing
* Split get entities
* Func rename
* Move FritzBoxBaseSwitch to switch.py
* Removed lambda
* Update homeassistant/components/fritz/common.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/fritz/common.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/fritz/switch.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/fritz/switch.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/fritz/switch.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/fritz/switch.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Fixes after applying comments
* Remvoed redundant try block
* Removed broad-except
* Optimized async/sync switch
* Update homeassistant/components/fritz/switch.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/fritz/switch.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/fritz/switch.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Address remaining comments
* Optimize return list
* More optimization for return lists
* Some missing strict typing
* Redundant typing
* Update homeassistant/components/fritz/switch.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Wrong if
* Introduce const for profile status
* Update homeassistant/components/fritz/switch.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/fritz/switch.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Fix mypy
* Switch back to get_local_ip()
* Address latest comments
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Aaron David Schneider <aaron.schneider@nbi.ku.dk>
* Fix breaking loop if single bad currency
* Remove unneeded update
* Reduce executor calls and use helper
* Avoid setting up integration when not needed in test
* Remove defunct info from strings
* Move already configured check
* Move instance update out of data class init
* Support setting hvac_mode and temp in same set_temperature service call
* Update homeassistant/components/homekit_controller/climate.py
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Update homeassistant/components/homekit_controller/climate.py
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Add switch platform to Modern Forms integration
* Add reboot switch
* Update lib to catch status from switches
* lint ignore
* Removed reboot switch
* bump aiomodernforms for dependency cleanup
* Changed Testing, removed custom exception
Removed custom exceptions, reverted to builtin. Changed testing approach in all tests, now using the core interface to setup device and mock_requests to create test responses for all calls.
* Reintroduce InvalidAuth exception in __init__
Remove reference to internal HA exception, Reintroduce custom exception
* Removed duplicate entry in test_config_flow
* removed tests from test_init that calling methods directly
* Update tests/components/wallbox/__init__.py
Removed duplicate add_to_hass call
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* MetOfficeData now retrieves both 3-hourly and daily data (full forecast data, as well as "now" snapshot) on each update
* Bump datapoint API up to latest version
* Create 2 sets of sensors - one of each set for 3-hourly and for daily data (same ones initially enabled, for now)
* Create two entities (one each for 3-hourly and daily data) and also add in the forecast data for each dataset
* Testing changes to accommodate now having two sets of everything for 3-hourly and daily update data
* Removed unused import (reported by flake8)
* As per conversation with @MatthewFlamm leave the 3-hourly entity's unique_id unchanged (although the display name is changed)
* Make some improvements based on reviews
Make some improvements and fix up the formatting/linting failures.
* Make some improvements based on reviews
Make some improvements and fix up the formatting/linting failures.
* Added more test coverage
* import asyncio
* Try to fix test
* Rewrote everything using CoordinatorEntity
* Fixed config flow
* Fixed lint errors
Co-authored-by: MrHarcombe <ian.harcombe@gmail.com>
Co-authored-by: Henco Appel <hencoappel+github@gmail.com>
* Handle connection being closed in legacy samsungtv
- Mirror the websocket behavior
Fixes
```
2021-06-24 02:54:13 ERROR (MainThread) [homeassistant.helpers.entity] Update for media_player.89_guestroom fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 401, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 609, in async_device_update
raise exc
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/samsungtv/media_player.py", line 124, in update
self._state = STATE_ON if self._bridge.is_on() else STATE_OFF
File "/usr/src/homeassistant/homeassistant/components/samsungtv/bridge.py", line 113, in is_on
return self._get_remote() is not None
File "/usr/src/homeassistant/homeassistant/components/samsungtv/bridge.py", line 232, in _get_remote
self._remote = Remote(self.config.copy())
File "/usr/local/lib/python3.8/site-packages/samsungctl/remote.py", line 9, in __init__
self.remote = RemoteLegacy(config)
File "/usr/local/lib/python3.8/site-packages/samsungctl/remote_legacy.py", line 32, in __init__
self._read_response(True)
File "/usr/local/lib/python3.8/site-packages/samsungctl/remote_legacy.py", line 77, in _read_response
raise exceptions.ConnectionClosed()
samsungctl.exceptions.ConnectionClosed
```
* add coverage
* pass instead
* Fix zwave_js migration logic
* revert change to move tests to new module
* Update tests/components/zwave_js/test_init.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Add WS API for listing available statistic ids
* Update homeassistant/components/history/__init__.py
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Bram Kragten <mail@bramkragten.nl>