🏡 Open source home automation that puts local control and privacy first.
Go to file
Antoine Reversat 1afed8ae15
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>
2024-08-18 15:37:33 +02:00
.devcontainer Update default pylint.importStrategy in dev container (#119900) 2024-06-19 11:27:01 +02:00
.github Bump home-assistant/builder from 2024.03.5 to 2024.08.1 (#123967) 2024-08-15 09:31:42 +02:00
.vscode Generate translation in vscode taks: Code Coverage (#120434) 2024-07-07 17:05:44 +02:00
homeassistant Add Fujitsu FGLair integration (#109335) 2024-08-18 15:37:33 +02:00
machine Fix Raspberry Pi utilities installation on Alpine 3.19 (#110463) 2024-02-13 15:07:37 +01:00
pylint Add monkeypatch to enforce-type-hints plugin (#121051) 2024-07-05 11:35:56 +02:00
rootfs Stop the Home Assistant Core container by default (#101105) 2023-09-30 10:43:07 +02:00
script Revert "Exclude aiohappyeyeballs from license check" (#124116) 2024-08-17 10:10:45 -05:00
tests Add Fujitsu FGLair integration (#109335) 2024-08-18 15:37:33 +02:00
.core_files.yaml Update audit licenses run conditions [ci] (#123009) 2024-08-01 11:30:29 +02:00
.dockerignore Not to Tox (#76582) 2022-11-23 14:40:37 +01:00
.git-blame-ignore-revs Add ruff commit to git-blame-ignore-revs (#114229) 2024-03-26 12:16:55 +01:00
.gitattributes Ensure .pcm binary files do not have line endings changed (#91881) 2023-04-22 22:22:30 -04:00
.gitignore Add `__pycache__` to gitignore (#114056) 2024-05-18 13:30:03 +02:00
.hadolint.yaml Update base image to 2023.10.0 (#102126) 2023-10-18 19:11:41 +02:00
.pre-commit-config.yaml Bump ruff to 0.6.0 (#123985) 2024-08-16 16:54:20 +02:00
.prettierignore Remove outdated prettier and yamllint `azure-*.yml` ignores (#112819) 2024-03-09 14:44:05 +02:00
.strict-typing Add Fujitsu FGLair integration (#109335) 2024-08-18 15:37:33 +02:00
.yamllint Remove outdated prettier and yamllint `azure-*.yml` ignores (#112819) 2024-03-09 14:44:05 +02:00
CLA.md
CODEOWNERS Add Fujitsu FGLair integration (#109335) 2024-08-18 15:37:33 +02:00
CODE_OF_CONDUCT.md Update codespell to 2.3.0 (#118001) 2024-05-24 08:22:29 +02:00
CONTRIBUTING.md
Dockerfile Update uv to 0.2.27 (#122246) 2024-07-20 13:24:21 +02:00
Dockerfile.dev Use uv instead of pip in development env (#113517) 2024-05-21 09:56:31 +02:00
LICENSE.md
MANIFEST.in Move remaining keys to `setup.cfg` (#65154) 2022-01-28 20:18:09 -08:00
README.rst Add Open Home Foundation link (#116405) 2024-04-29 21:28:47 +02:00
build.yaml Update Home Assistant base image to 2024.06.1 (#120168) 2024-06-22 18:52:44 +02:00
codecov.yml Remove coveragerc (#121286) 2024-07-05 11:03:31 +02:00
mypy.ini Add Fujitsu FGLair integration (#109335) 2024-08-18 15:37:33 +02:00
pyproject.toml Enable implicit-return (RET503) rule in ruff (#122771) 2024-08-12 10:04:16 +02:00
requirements.txt Bump aiohttp to 3.10.3 (#123549) 2024-08-10 15:09:18 -05:00
requirements_all.txt Add Fujitsu FGLair integration (#109335) 2024-08-18 15:37:33 +02:00
requirements_test.txt Update mypy-dev to 1.12.0a2 (#122613) 2024-07-25 21:48:10 +02:00
requirements_test_all.txt Add Fujitsu FGLair integration (#109335) 2024-08-18 15:37:33 +02:00
requirements_test_pre_commit.txt Bump ruff to 0.6.0 (#123985) 2024-08-16 16:54:20 +02:00

README.rst

Home Assistant |Chat Status|
=================================================================================

Open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server.

Check out `home-assistant.io <https://home-assistant.io>`__ for `a
demo <https://demo.home-assistant.io>`__, `installation instructions <https://home-assistant.io/getting-started/>`__,
`tutorials <https://home-assistant.io/getting-started/automation/>`__ and `documentation <https://home-assistant.io/docs/>`__.

This is a project of the `Open Home Foundation <https://www.openhomefoundation.org/>`__.

|screenshot-states|

Featured integrations
---------------------

|screenshot-integrations|

The system is built using a modular approach so support for other devices or actions can be implemented easily. See also the `section on architecture <https://developers.home-assistant.io/docs/architecture_index/>`__ and the `section on creating your own
components <https://developers.home-assistant.io/docs/creating_component_index/>`__.

If you run into issues while using Home Assistant or during development
of a component, check the `Home Assistant help section <https://home-assistant.io/help/>`__ of our website for further help and information.

.. |Chat Status| image:: https://img.shields.io/discord/330944238910963714.svg
   :target: https://www.home-assistant.io/join-chat/
.. |screenshot-states| image:: https://raw.githubusercontent.com/home-assistant/core/dev/.github/assets/screenshot-states.png
   :target: https://demo.home-assistant.io
.. |screenshot-integrations| image:: https://raw.githubusercontent.com/home-assistant/core/dev/.github/assets/screenshot-integrations.png
   :target: https://home-assistant.io/integrations/