* Add additional tests for Matter update entity
Extend test coverage for Matter update entity. This includes tests for
error handling and state store/restore.
* Improve test descriptions
* Add restore test only (using mock_restore_cache_with_extra_data)
* Fix test_update_state_save_and_restore test
* Use homeassistant constants
* Use update component constants
* Use freezer to skip time for device update check
We check device updates every 12h currently. Use the freezer to skip
time.
Still add a test which uses the service call to make sure this works
too.
* Initial SMLIGHT integration
Signed-off-by: Tim Lunn <tl@smlight.tech>
* Generated content
Signed-off-by: Tim Lunn <tl@smlight.tech>
* Cleanup LOGGING
* Use runtime data
* Call super first
* coordinator instance attributes
* Move coordinatorEntity and attr to base class
* cleanup sensors
* update strings to use sentence case
* Improve reauth flow on incorrect credentials
* Use fixture for config_flow tests and test to completion
* Split uptime hndling into a new uptime sensor entity
* Drop server side events and internet callback
will bring this back with binary sensor Platform
* consolidate coordinator setup
* entity always include connections
* get_hostname tweak
* Add tests for init, coordinator and sensor
* Use custom type SmConfigEntry
* update sensor snapshot
* Drop reauth flow for later PR
* Use _async_setup for initial setup
* drop internet to be set later
* sensor fixes
* config flow re
* typing fixes
* Bump pysmlight dependency to 0.0.12
* dont trigger invalid auth message when first loading auth step
* Merge uptime sensors back into main sensor class
* clarify uptime handling
* Apply suggestions from code review
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
* address review comments
* pass host as parameter to the dataCoordinator
* drop uptime sensors for a later PR
* update sensor test snapshot
* move coordinator unique_id to _async_setup
* fix CI
* Apply suggestions from code review
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
* drop invalid_auth test tag
* use snapshot_platform, update fixtures
* Finish all tests with abort or create entry
* drop coordinator tests and remove hostname support
* add test for update failure on connection error
* use freezer for update_failed test
* fix pysmlight imports
---------
Signed-off-by: Tim Lunn <tl@smlight.tech>
Co-authored-by: Tim Lunn <tim@feathertop.org>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
* Add switch platform to Nice G.O.
* Replace cover with switch in switch.py
* Use icon translations
* Fix tests
* Use constants in test_switch.py
* Use ATTR_ENTITY_ID
* Addition of a reload service to manually retrieve the status of the devices.
* Removal of reload_state service replaced by the homeassistant.update_entity supported service
* remove api update to v1.2.1 for another PR
* Review corrections
* Review corrections
* feat: add reconfigure
* feat: add reconfigure step
* fix: don't abort unique on reconfigure
* fix: add success string
* fix: improve reconfigure
* fix: entry will never be none
* fix: update ip in abort
* fix: check unique id on reconfigure
* feat: add test in case of new device
* fix: fail reconfigure if mac changes
* fix: abort instead of form
* feat: use is, dont mock config flow
* fix: implement comments
* Add support for Fujitsu HVAC devices
* Add the entity code to .coveragerc
* Only include code that can fail in the try/except block
Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>
* Remove empty keys from manifest
* Remove VERSION as it's already the default
* Remve the get_devices function and use asyncio.gather to parallelize dev updates
* Move initial step to a function
* Let KeyError bubble up. If we are passed an invalid mode it's probably worth raising an exception.
* Await the gather
* Use the async version of the refresh_auth call
* Use the serial number as unique id
* Use HA constant for precision
* Use dev instead of self._dev
* Move to property decorated methods
* Remove bidict dependency
* Setup one config entry for our api credentials instead of per device
* Remove bidict from requirements
* Signout and remove our api object on unload
* Use app credentials from ayla_iot_unofficial
* Use entry_id as a key to store our API object
* Delete unused code
* Create reverse mappings from forward mapping instead of hardcoding them
* Clean up the property methods
* Only import part of config_entries we are using
* Implement suggested changes
* Fix tests to use new API consts
* Add support for reauth
* Use a coordinator instead of doing per-entity refresh
* Auto is equivalent to HEAT_COOL not AUTO
* Add ON and OFF to list of supported features
* Use the mock_setup_entry fixture for the reauth tests
* Parametrize testing of config flow exceptions
* Only wrap fallable code in try/except
* Add tests for coordinator
* Use self.coordinator_context instead of self._dev.device_serial_number
* Move timeout to ayla_iot_unofficial
* Add description for is_europe field
* Bump version of ayla-iot-unofficial
* Remove turn_on/turn_off warning
* Move coordinator creating to __init__
* Add the type of coordinator to the CoordiatorEntity
* Update docstring for FujitsuHVACDevice constructor
* Fix missed self._dev to dev
* Abort instead of showing the form again with an error when usernames are different
* Remove useless argument
* Fix tests
* Implement some suggestions
* Use a device property the maps to the coordinator data
* Fix api sign out when unloading the entry
* Address comments
* Fix device lookup
* Move API sign in to coordinator setup
* Get rid of FujitsuHVACConfigData
* Fix async_setup_entry signature
* Fix mock_ayla_api
* Cleanup common errors
* Add test to check that re adding the same account fails
* Also patch new_ayla_api in __init__.py
* Create a fixture to generate test devices
* Add a setup_integration function that does the setup for a mock config entry
* Rework unit tests for the coordinator
* Fix typos
* Use hass session
* Rework reauth config flow to only modify password
* Update name to be more use-friendly
* Fix wrong type for entry in async_unload_entry
* Let TimeoutError bubble up as teh base class handles it
* Make the mock ayla api return some devices by default
* Move test to test_climate.py
* Move tests to test_init.py
* Remove reauth flow
* Remove useless mock setup
* Make our mock devices look real
* Fix tests
* Rename fujitsu_hvac to fujitsu_fglair and rename the integration to FGLair
* Add the Fujitsu brand
* Add a helper function to generate an entity_id from a device
* Use entity_id to remove hardcoded entity ids
* Add a test to increase code coverage
---------
Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Joostlek <joostlek@outlook.com>
* Support harvey brand
* Update tests
* Moved the brand selection step to the same step as credentials
* Update tests/components/aquacell/test_init.py
---------
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
* Add temperature sensors for device
* Move to single line
* Use right reference
* Always return a value
* Update tests
* Use slugify for id name
* Return default value if not present
* Make _device_temperature return value
* Add default value if temperatures is None
* Set value to go over all code paths
* Add test for no matching temperatures
* make first part deterministic
* Add statistics import to Ista EcoTrend integration
* Use decorator for fixtures
* define recorder as after_dependency
* Increase test coverage
* remember initial statistic_id
* fix type checking
* Publish raw rendered mqtt payload as raw for mqtt publish action
* Move check out of try block
* Only try to eval `bytes` is payload starts with supported string
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Improve docst
* Add `evaluate_bytes` option to publish action
* Rename to `evaluate_payload`
* Update homeassistant/components/mqtt/strings.json
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Extend test to assert literal_eval is called or not
---------
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Do a sanity check of schema passed to EntityPlatform.async_register_entity_service
* Only attempt to check schema of Schema
* Handle All/Any wrapped in schema
* Clarify comment
* Apply suggestions from code review
Co-authored-by: Robert Resch <robert@resch.dev>
---------
Co-authored-by: Robert Resch <robert@resch.dev>
* Add config flow to select platform in Template
* Remove device id duplicate in schema
* Add config flow for number platform in Template
* Remove mode
* Add tests
* Fix entity test
* Format
* Fix sensor tests
* Fix sensor tests
* Fix sensor tests
* Add init tests
* Change service info
* Rename test_sensor parameters
* Removce ConfigEntryState.LOADED assertion
* Remove platforms parameter from setup_platform
* Rename setup_platform to setup_integration
* Fixture for blind_type and mock_config_entry
* Use mock for MotionDevice
* Use mock for MotionDevice
* Add type hint
* Use Mock instead of patch
* Use mock_config_entry fixture
* Move constants to init
* Fix entity_id name
* Use fixture
* Use fixtures instead of constants
* Use display_name fixture
* Rename mac to mac_code
* Remove one patch
* Use fixtures for mock_config_entry
* Apply suggestion
* Replace patch with mock
* Replace patch with mock
* Replace patch with mock
* Fix
* Use pytest.mark.usefixtures if parameter not used
* Base mac code on address
* Remove if statement from entity test
---------
Co-authored-by: Joostlek <joostlek@outlook.com>