24 Commits

Author SHA1 Message Date
Maciej Bieniek
88821b1d0e
Use aioshelly methods with Shelly RPC number entities (#142482) 2025-04-22 12:44:02 +02:00
Simone Chemelli
8bedf97382
Remove helpers and align coding style in Shelly tests (#140080)
* Cleanup hass.states method in Shelly tests (part 1)

* remove helper functions and align coding style

* missed

* revert unwanted changes

* apply review comment

* apply review comment

* apply review comment

* apply ATTR where missing

* apply walrus

* add missed walrus

* add walrus to entity_registry.async_get

* minor tweak

* align after merge
2025-03-26 10:05:42 +01:00
Maciej Bieniek
95cc3e31f5
Add exceptions translations for Shelly integration (#141071)
* Add exceptions translations

* Improve exception strings for update platform

* Fix tests

* Improve device_communication_error

* Remove error placeholder

* Improve tests

* Fix test_rpc_set_state_errors

* Strings improvement

* Remove `device`

* Remove `entity`

* Fix tests
2025-03-24 17:16:29 +01:00
Maciej Bieniek
2785688f57
Add calibrate button for Shelly BLU TRV (#140578)
* Initial commit

* Refactor

* Call async_add_entities() once

* Type

* Cleaning

* `supported` is not needed here

* Add error handling

* Add test

* Fix name

* Change class name

* Change method name

* Move BLU_TRV_TIMEOUT

* Fix BLU_TRV_TIMEOUT import

* Coverage

* Use test snapshots

* Support error translations

* Fix tests

* Introduce ShellyBaseButton class

* Rename press_method to _press_method

* Improve exception strings
2025-03-21 10:14:20 +01:00
Maciej Bieniek
7bc0c1b912
Bump aioshelly to version 13.0.0 (#139294)
* Bump aioshelly to version 13.0.0

* MODEL_BLU_GATEWAY_GEN3 -> MODEL_BLU_GATEWAY_G3
2025-02-25 23:52:44 +02:00
Maciej Bieniek
aa6fa3cdad
Don't use the current temperature from Shelly BLU TRV as a state for External Temperature number entity (#137658)
Introduce RpcBluTrvExtTempNumber for External Temperature entity
2025-02-07 16:32:28 +01:00
Maciej Bieniek
ea92523af4
Bump aioshelly to 12.3.2 (#136486)
* Bump aioshelly

* Add timeout parameter for call_rpc

* Increase timeout for BLU TRV

* Log timeout

* Update test

* Use const in test

* Coverage
2025-01-27 18:06:03 +01:00
Maciej Bieniek
11d44e608b
Add additional entities for Shelly BLU TRV (#135244)
* Add valve position sensor

* Add valve position and external sensor temperature numbers

* Fix method name

* Better name

* Add remove condition

* Add calibration binary sensor

* Add battery and signal strength sensors

* Remove condition from ShellyRpcEntity

* Typo

* Add get_entity_class helper

* Add tests

* Use snapshots in tests
2025-01-21 00:11:20 +02:00
J. Nick Koston
be206156b0
Fix shelly sleepy entities never being created (#124547) 2024-08-25 09:21:23 -10:00
Maciej Bieniek
260e98c3f7
Add support for Shelly number virtual component (#121894)
* Support number component in field mode

* Support number in label mode

* Add tests

* Add mode_fn

* Add support for number component in slider mode

* Add comment

* Suggested change

* Revert max_fn

* Change unit 'min' to 'Hz' in test

---------

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-07-15 22:26:12 +02:00
Shay Levy
40b98b70b0
Wait for background tasks in Shelly tests (#119636) 2024-06-13 22:36:03 +03:00
epenet
08eb8232e5
Fix namespace-import pylint warning in shelly tests (#119349) 2024-06-11 08:08:47 +02:00
Shay Levy
ecd48cc447
Clean up Shelly unneccesary async_block_till_done calls (#118141) 2024-05-26 00:28:48 +03:00
J. Nick Koston
9ca1d204b6
Fix shelly delaying shutdown (#116346) 2024-04-28 11:19:38 -05:00
Shay Levy
291df6dafe
Bump aioshelly to 9.0.0 (#114025)
* Update Shelly to use initialize from aioshelly

* Save indentation in _async_device_connect

* Use firmware_supported property from aioshelly

* Review comments

* Bump aioshelly

* Fix lint errors

* Test RPC initialized update
2024-04-14 18:07:26 +03:00
epenet
9204ccfa17
Use is in ConfigEntryState enum comparison in tests (N-Z) (#114926) 2024-04-05 17:37:00 +02:00
Marc Mueller
7d6251ca08
Add empty line after module docstring [tests q-s] (#112711) 2024-03-08 14:47:22 +01:00
Maciej Bieniek
8de038527f
Improve type annotation in Shelly tests (#110361)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-02-12 10:23:55 -06:00
Maciej Bieniek
d0384480f5
Test unique IDs for Shelly entities (#109879)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-02-07 10:18:00 -06:00
J. Nick Koston
3a06659120
Speed up single entity/response service calls (#96729)
* Significantly speed up single entity/response service calls

Since the majority of service calls are single entity, we can
avoid creating tasks in this case. Since the multi-entity
service calls always check the result and raise, we can switch
the asyncio.wait to asyncio.gather

* Significantly speed up single entity/response service calls

Since the majority of service calls are single entity, we can
avoid creating tasks in this case. Since the multi-entity
service calls always check the result and raise, we can switch
the asyncio.wait to asyncio.gather

* revert

* cannot be inside pytest.raises

* one more

* Update homeassistant/helpers/service.py
2023-07-17 09:33:13 +02:00
Maciej Bieniek
fe61672792
Don't inherit SensorEntity/NumberEntity and RestoreEntity in Shelly integration (#93531)
* Use RestoreNumber and Restore Sensor for block entities

* Update tests

* Use RestoreSensor for RPC entities

* Fix test for number platform
2023-06-04 19:14:08 -05:00
epenet
80ee196fd8
Add type hints to integration tests (part 19) (#88178) 2023-02-15 18:07:40 +01:00
Shay Levy
803cd8d9a3
Handle state unknown if last state is missing in Shelly (#86813)
Shelly - handle state unknown if last state is missing
2023-01-27 23:34:56 +01:00
Shay Levy
91a44b697b
Add tests coverage for Shelly number platform (#82480) 2022-11-21 10:55:06 -06:00