Commit Graph
56 Commits
Author SHA1 Message Date
epenet 54c20d5d5a Use async_load_fixture in remaining tests (#146021) 2025-06-03 10:52:51 +02:00
Abílio Costa b626204f63 Add default device class display precision for Sensor (#145013)
* Add default device class display precision for Sensor

* Renaming, docstrings, cleanup

* Simplify units list

* Fix tests

* Fix missing precision when suggested is specified

* Update snapshots

* Fix when unit of measurement is not valid

* Fix tests

* Fix deprecated unit usage

* Fix goalzero tests

The sensor native_value method was accessing the data dict and trowing,
since the mock did not have any data for the sensors.

Since now the precision is always specified (it was missing for those
sensors), the throw was hitting async_update_entity_options in _update_suggested_precision.
Previously, async_update_entity_options was not called since it had no
precision.

* Fix metoffice

* Fix smartthings

* Add default sensor data for Tesla Wall Connector tests

* Update snapshots

* Revert spaces

* Update smartthings snapshots

* Add missing sensor mock for tesla wall connector

* Address review comments

* Add doc comment

* Add cap to doc comment

* Update comment

* Update snapshots

* Update comment
2025-05-26 19:40:29 +02:00
Simone Chemelli 484a547758 Fix pylance warning on SnapshotAssertion import (#145206) 2025-05-19 13:55:48 +02:00
John HilleryandJ. Nick Koston 9729f1f38b Provide ability to select nexia RoomIQ sensors (#144278)
Co-authored-by: J. Nick Koston <nick@koston.org>
2025-05-13 23:16:05 -05:00
Joost Lekkerkerker 308f25fe4c Migrate Nexia unique id to str (#126911) 2024-09-27 14:35:08 +02:00
epenet 99b349fa2c Fix consider-using-dict-items warnings in tests (#119497) 2024-06-12 16:44:29 +02:00
epenet ead0e797c1 Use registry fixtures in tests (m-n) (#118291) 2024-05-28 13:40:45 +02:00
epenet a3942e019b Use remove_device helper in tests (2/2) (#116442)
Use remove_device helper in tests (part 2)
2024-04-30 12:50:35 +02:00
epenet 9204ccfa17 Use is in ConfigEntryState enum comparison in tests (N-Z) (#114926) 2024-04-05 17:37:00 +02:00
Joost Lekkerkerker f3ba713289 Use FlowResultType enum in config flow tests N-Z (#114682)
Use FlowResultType enum in config flow tests
2024-04-03 09:53:20 +02:00
6bb4e7d62c Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
Marc Mueller 32f3f46542 Add empty line after module docstring (2) [tests.components] (#112737) 2024-03-08 19:16:21 +01:00
Marc Mueller 1722e23df8 Add empty line after module docstring [tests l-p] (#112710) 2024-03-08 14:55:15 +01:00
Joost Lekkerkerker f02e60533d Add icon translations to Nexia (#111980)
* Add icon translations to Nexia

* Add icon translations to Nexia
2024-03-03 14:08:33 +01:00
Marc Mueller a9147cf3dd Use builtin TimeoutError [k-n] (#109681) 2024-02-05 12:08:18 +01:00
G Johansson bc720b48b4 Add TURN_OFF and TURN_ON to ClimateEntityFeature (#101673)
* Add ClimateEntityFeature.TURN_OFF

* Fixes

* Fixes

* wording

* Change to services

* Fixing

* Fixing

* Last bits

* Review comments

* Add hvac_modes checks

* Fixes

* Add tests

* Review comments

* Update snapshots

* balboa

* coolmaster

* ecobee

* mqtt

* nest

* plugwise

* smarttub

* whirlpool

* zwave_js

* fix test climate

* test climate

* zwave

* nexia

* nuheat

* venstar

* tado

* smartthings

* self.hvac_modes not None

* more tests

* homekit_controller

* homekit controller snapshot
2024-01-30 15:07:47 +01:00
Jan-Philipp Benecke 7b204ca36b Use snapshot assertion for nexia diagnostics test (#100328) 2023-09-13 15:00:29 -05:00
Joost Lekkerkerker 097c7fbfef Add entity translations to Nexia (#98803) 2023-08-22 07:41:15 -05:00
Benjamin Paul [MSFT]andG Johansson 5965918c86 Add Fan Speed number entity to Nexia (#98642)
* Add Fan Speed support to Nexia integration

Adds a new "set_fan_speed" service to the Nexia integration, to allow
setting speed of the air-handler/blower fans.

* Add Fan Speed to Nexia Tests

* Remove mistakenly-added changes to Climate tests

A previous version of this change made modifications to the base
Climate entity, but that approach was later abandonded. These changes
to Climate tests were left over from that, and should never have been
included.

* Add Fan Speed Number Entity

* Remove Set Fan Speed Service

* Remove fan_speed attribute

The fan_speed attribute is not necessary with the new Number entity.

* Address reviewer feedback

Rename test function to reflect fact that fan speed entities are
entities, and not sensors.
Added missing typing to variables.
Sorted list of platforms

* Add test_set_fan_speed

Also adds new test fixture for mock response to API call

* Update homeassistant/components/nexia/number.py

* Name change

---------

Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2023-08-19 16:42:13 +02:00
J. Nick Koston 61e57872c3 Fix not retrying on connection reset during nexia config entry setup (#93576)
* Fix not retrying on connection reset during nexia config entry setup

fixes
```
2023-05-26 00:15:39.129 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Alexander for nexia
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 558, in _request
    resp = await req.send(conn)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 670, in send
    await writer.write_headers(status_line, self.headers)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_writer.py", line 130, in write_headers
    self._write(buf)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_writer.py", line 75, in _write
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/nexia/__init__.py", line 47, in async_setup_entry
    await nexia_home.login()
  File "/usr/local/lib/python3.11/site-packages/nexia/home.py", line 385, in login
    request = await self.post_url(self.API_MOBILE_ACCOUNTS_SIGN_IN_URL, payload)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/nexia/home.py", line 157, in post_url
    response: aiohttp.ClientResponse = await self.session.post(
                                       ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 572, in _request
    raise ClientOSError(*exc.args) from exc
aiohttp.client_exceptions.ClientOSError: Cannot write to closing transport
```

* coverage
2023-05-25 21:52:44 -04:00
epenet 50cbabb2d8 Add type hints to integration tests (part 15) (#88006) 2023-02-15 10:00:49 +01:00
epenet 3abf7ea18a Add type hints to integration tests (m-p) (#87705) 2023-02-08 07:48:54 -08:00
epenet aa00114c2f Add return type to async tests without arguments (#87612) 2023-02-07 10:26:56 +01:00
Franck Nijhof 5e81d28116 Update black to 23.1.0 (#87188) 2023-02-02 18:35:24 +01:00
Franck Nijhof 4955dd3e1b Code styling tweaks to Nexia tests (#86660) 2023-01-25 23:36:17 +01:00
Michael 104f74054b Replace the usage of unit constants by enumerations in Tests [m-n] (#85935)
* replace unit conts by enums m-n

* fix mqtt
2023-01-15 15:45:00 +01:00
epenet 0d696b84b2 Cleanup root component imports in tests (#78893) 2022-09-21 06:57:41 -10:00
J. Nick KostonandPaulus Schoutsen 15ed329108 Add async_remove_config_entry_device support to nexia (#73966)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-06-25 12:02:38 -04:00
J. Nick Koston 1c4c0f1eb3 Small fixes and cleanups to legacy nexia code (#72176) 2022-05-19 11:50:54 -05:00
J. Nick Koston d8a580a90f Update nexia to use asyncio (#72108) 2022-05-18 18:08:02 -05:00
J. Nick Koston b562416eb2 Remove humidify_supported and dehumidify_supported attributes from nexia (#71248)
These non-standard attributes can already be infered from the dehumidify_setpoint
or humidify_setpoint and took up space in the database every time
any of the values changes
2022-05-03 17:33:50 +03:00
epenet 7fb8bb7769 Use climate enums in nexia (#70725) 2022-04-25 21:06:33 -10:00
epenet 9aac5d6af1 Prettify json (#68895) 2022-03-30 12:15:04 +02:00
epenet 053c4428a9 Prettify json (component test fixtures) (#68892) 2022-03-30 11:37:17 +02:00
J. Nick Koston 4b963c2ac0 Add diagnostics support to nexia (#68215) 2022-03-15 15:55:08 -10:00
J. Nick Koston 3d7572843e Add switch platform to nexia (#64205) 2022-01-16 09:38:29 -10:00
Paulus Schoutsen 31153ac155 Move fixtures part 1 (#58902) 2021-11-01 20:47:05 -07:00
Ville Skyttä 380cff167e Use HTTPStatus in components/[nop]* (#58279) 2021-10-23 20:56:30 +02:00
Paulus SchoutsenandMartin Hjelmare a4d9019ffc Refactor persistent notification to no longer route all data via a service (#57157)
* Convert persistent notification tests to async

* Create/dismiss persistent notifications in exposed functions, not service calls

* Fix notify persistent_notification

* Remove setting up persistent_notification

* Drop more setups

* Empty methods

* Undeprecate sync methods because too big task

* Fix setup clearing notifications

* Fix a bunch of tests

* Fix more tests

* Uno mas

* Test persistent notification events

* Clean up stale comment

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-10-07 12:58:00 +02:00
J. Nick Koston 8e38f26978 Add support for asair brand to nexia (#50504) 2021-05-15 16:24:36 +02:00
Franck Nijhof 7264c95217 Clean up superfluous integration setup - part 6 (#49298) 2021-04-16 09:23:27 -07:00
J. Nick Koston db83aea1df Remove YAML support from nexia (#45379) 2021-01-21 13:45:52 -05:00
Franck Nijhof 65cf2fcb6f Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
Paulus Schoutsen 1c36bf5e19 Fix block till done in create entry config flow tests (#42290) 2020-10-24 16:20:56 +02:00
springstan d2b1918e9c Drop UNIT_ prefix for percentage constant (#39383) 2020-09-05 21:09:14 +02:00
J. Nick KostonandPaulus Schoutsen ebc31c0f08 Do not treat nexia http not found as invalid auth (#39484)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-09-04 16:54:27 +02:00
Franck Nijhof 1c2ebdf307 Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
Paulus Schoutsen ec47216388 Use built-in test helpers on 3.8 (#34901) 2020-04-30 13:29:50 -07:00
J. Nick Koston 97c82089b4 Abort nexia import if the username is already configured (#34863) 2020-04-29 14:02:59 -07:00
J. Nick Koston f965fb6350 Fix nexia fan and hold modes for XL824 thermostats (#34042)
* Fix nexia fan and hold modes for XL824 thermostats

* Update nexia to 0.9.0

* Update tests to reflect the modes that now come directly in
2020-04-12 15:25:57 +02:00