-
- Downloads
Add Fujitsu FGLair integration (#109335)
* 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>
Showing
- .strict-typing 1 addition, 0 deletions.strict-typing
- CODEOWNERS 2 additions, 0 deletionsCODEOWNERS
- homeassistant/brands/fujitsu.json 5 additions, 0 deletionshomeassistant/brands/fujitsu.json
- homeassistant/components/fujitsu_fglair/__init__.py 49 additions, 0 deletionshomeassistant/components/fujitsu_fglair/__init__.py
- homeassistant/components/fujitsu_fglair/climate.py 141 additions, 0 deletionshomeassistant/components/fujitsu_fglair/climate.py
- homeassistant/components/fujitsu_fglair/config_flow.py 73 additions, 0 deletionshomeassistant/components/fujitsu_fglair/config_flow.py
- homeassistant/components/fujitsu_fglair/const.py 54 additions, 0 deletionshomeassistant/components/fujitsu_fglair/const.py
- homeassistant/components/fujitsu_fglair/coordinator.py 63 additions, 0 deletionshomeassistant/components/fujitsu_fglair/coordinator.py
- homeassistant/components/fujitsu_fglair/manifest.json 9 additions, 0 deletionshomeassistant/components/fujitsu_fglair/manifest.json
- homeassistant/components/fujitsu_fglair/strings.json 25 additions, 0 deletionshomeassistant/components/fujitsu_fglair/strings.json
- homeassistant/generated/config_flows.py 1 addition, 0 deletionshomeassistant/generated/config_flows.py
- homeassistant/generated/integrations.json 16 additions, 4 deletionshomeassistant/generated/integrations.json
- mypy.ini 10 additions, 0 deletionsmypy.ini
- requirements_all.txt 3 additions, 0 deletionsrequirements_all.txt
- requirements_test_all.txt 3 additions, 0 deletionsrequirements_test_all.txt
- tests/components/fujitsu_fglair/__init__.py 21 additions, 0 deletionstests/components/fujitsu_fglair/__init__.py
- tests/components/fujitsu_fglair/conftest.py 113 additions, 0 deletionstests/components/fujitsu_fglair/conftest.py
- tests/components/fujitsu_fglair/snapshots/test_climate.ambr 189 additions, 0 deletionstests/components/fujitsu_fglair/snapshots/test_climate.ambr
- tests/components/fujitsu_fglair/test_climate.py 98 additions, 0 deletionstests/components/fujitsu_fglair/test_climate.py
- tests/components/fujitsu_fglair/test_config_flow.py 107 additions, 0 deletionstests/components/fujitsu_fglair/test_config_flow.py
Loading
Please register or sign in to comment