Commit Graph

61 Commits

Author SHA1 Message Date
Maciej Bieniek
7f4cc99a3e Use sub-devices for Shelly multi-channel devices (#144100)
* Shelly RPC sub-devices

* Better varaible name

* Add get_rpc_device_info helper

* Revert channel name changes

* Use get_rpc_device_info

* Add get_rpc_device_info helper

* Use get_block_device_info

* Use helpers in the button platform

* Fix channel name and roller mode for block devices

* Fix EM3 gen1

* Fix channel name for RPC devices

* Revert test changes

* Fix/improve test_block_get_block_channel_name

* Fix test_get_rpc_channel_name_multiple_components

* Fix tests

* Fix tests

* Fix tests

* Use key instead of index to generate sub-device identifier

* Improve logic for Pro RGBWW PM

* Split channels for em1

* Better channel name

* Cleaning

* has_entity_name is True

* Add get_block_sub_device_name() function

* Improve block functions

* Add get_rpc_sub_device_name() function

* Remove _attr_name

* Remove name for button with device class

* Fix names of virtual components

* Better Input name

* Fix get_rpc_channel_name()

* Fix names for Inputs

* get_rpc_channel_name() improvement

* Better variable name

* Clean RPC functions

* Fix input_name type

* Fix test

* Fix entity_ids for Blu Trv

* Fix get_block_channel_name()

* Fix for Blu Trv, once again

* Revert name for reboot button

* Fix button tests

* Fix tests

* Fix coordinator tests

* Fix tests for cover platform

* Fix tests for event platform

* Fix entity_ids in init tests

* Fix get_block_channel_name() for lights

* Fix tests for light platform

* Fix test for logbook

* Update snapshots for number platform

* Fix tests for sensor platform

* Fix tests for switch platform

* Fix tests for utils

* Uncomment

* Fix tests for flood

* Fix Valve entity name

* Fix climate tests

* Fix test for diagnostics

* Fix tests for init

* Remove old snapshots

* Add tests for 2PM Gen3

* Add comment

* More tests

* Cleaning

* Clean fixtures

* Update tests

* Anonymize coordinates in fixtures

* Split Pro 3EM entities into sub-devices

* Make sub-device names more unique

* 3EM (gen1) does not support sub-devices

* Coverage

* Rename "device temperature" sensor to the "relay temperature"

* Update tests after rebase

* Support sub-devices for 3EM (gen1)

* Mark has-entity-name rule as done 🎉

* Rename `relay temperature` to `temperature`
2025-05-26 10:47:22 +02:00
Shay Levy
71599b8e75 Set Shelly PARALLEL_UPDATES (#144070) 2025-05-01 21:20:50 +02:00
Simone Chemelli
a170e32852 Deprecate Shelly state attributes (#140791) 2025-03-18 17:29:21 +02:00
Erik Montnemery
f83c8de8d3 Update signature of platforms' async_setup_entry (#138201) 2025-02-10 21:08:03 +01:00
Simone Chemelli
cce6c735ad Add support for Shelly Flood gen4 (#136981) 2025-02-03 13:04:14 +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
Maciej Bieniek
1290f18ed4 Add support for Shelly CCT light (#126989)
* Initial support for cct lights

* Move properties to the RpcShellyCctLight class

* Fix entity names

* Add async_remove_orphaned_entities() function

* Do not return

* Fix tests

* Combine async_remove_orphaned_virtual_entities and async_remove_orphaned_entities

* Remove SHELLY_PLUS_RGBW_CHANNELS from const

* Add tests

* Use _attr*

* Check ColorMode.COLOR_TEMP

* Add sensors for CCT light

* Remove removal condition

* Remove orphaned sensors

* Cleaning

* Add device temperature sensor for CCT light

* Simplify async_remove_orphaned_entities()

* Comment

* Add COMPONENT_ID_PATTERN const

* Call async_add_entities once

* Suggested change

* Better type for keys

* Do not call keys()
2024-10-04 08:49:35 +02:00
huettner94
eb3686af06 Add shelly overcurrent sensor for switches (#122494)
shelly: add overcurrent sensor for switches

just like overvoltage shelly switches can react to overcurrent and
diable the switch. Unfortunately this is is not mentioned anywhere in
the documentation.
It can be triggered by a device using more amps than set in
"Output protections" under the name "Overcurrent in amperes".
2024-07-25 21:22:18 +03:00
Maciej Bieniek
70f05e5f13 Add support for Shelly virtual boolean component (#119932)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-07-10 23:51:51 +02:00
Michael
8238cd9f22 Store runtime data inside the config entry in Shelly (#116763) 2024-05-04 12:41:25 +02:00
Shay Levy
ef3ab54f1d Fix Shelly WallDisplay device power (#114071) 2024-03-23 22:44:53 +02:00
Joost Lekkerkerker
b125a6b1bb Remove entity description mixin in Shelly (#112938)
* Remove entity description mixin in Shelly

* fix

* Fix
2024-03-10 22:15:23 +01:00
Marc Mueller
930a396712 Add empty line after module docstring [s] (#112704) 2024-03-08 14:33:51 +01:00
Simone Chemelli
780428fde6 Disable Shelly diagnostic binary sensor (#112497) 2024-03-06 13:47:16 +01:00
Simone Chemelli
8cd98a5319 Add Shelly restart required binary sensor (#112493) 2024-03-06 12:37:15 +01:00
Simone Chemelli
7359449636 Code quality for Shelly integration (#109061) 2024-01-30 09:47:52 +01:00
Shay Levy
28e18ce7bf Fix Shelly Gen1 entity description restore (#108052)
* Fix Shelly Gen1 entity description restore

* Update tests/components/shelly/test_sensor.py

Co-authored-by: J. Nick Koston <nick@koston.org>

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-01-15 20:53:56 +02:00
Erik Montnemery
0c2485bc03 Freeze integration entity descriptions (#105984)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-12-18 16:28:13 -10:00
Maciej Bieniek
bf93929826 Add support for Shelly Gen3 devices (#104874)
* Add support for Gen3 devices

* Add RPC_GENERATIONS const

* Add gen3 to tests

* More tests

* Add BLOCK_GENERATIONS const

* Use *_GENERATIONS constants from aioshelly
2023-12-11 22:58:56 +01:00
Maciej Bieniek
31dfa5561a Add external power sensor for Shelly Plus HT (#96768)
* Add external power sensor for Plus HT

* Tests
2023-07-17 22:07:24 +03: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
Maciej Bieniek
dea29f539f Use SensorDeviceClass.ENUM and add state attributes translations in Shelly integration (#89660) 2023-03-15 18:52:42 +01:00
Erik Montnemery
cc564026fa Move EntityCategory to homeassistant.const (#87792)
* Move EntityCategory to homeassistant.const

* Fix more imports
2023-02-09 20:15:37 +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
Maciej Bieniek
dae7bcf387 Migrate Shelly to the new entity naming style (#86574)
* Use new entity naming style in Shelly

* Suggested change

* Use lower case for gen2 description
2023-01-25 09:55:52 +01:00
Maciej Bieniek
a176de6d4b Add RPC smoke binary sensor to Shelly integration (#85697)
* Add RPS smoke binary sensor

* Remove index

* Remove the unnecessary attribute
2023-01-12 08:42:40 +01:00
Shay Levy
ea98f0e9e8 Add tests for Shelly binary_sensor platform (#82367)
* Add tests for Shelly binary_sensor platform

* Rename create to register for
2022-11-19 18:07:02 +02:00
Shay Levy
8e9457d808 Add Shelly support for sleeping Gen2 devices (#79889) 2022-10-18 22:42:22 +03:00
starkillerOG
4bdd8cb459 Shelly migrate to update entity (#78305)
* Add update entity

* fixes

* fixes

* change to CONFIG catogory

* return latest version if no update available

* fixes

* Remove firmware binary_sensors and buttons

* import Callable from collections

* remove ota_update tests

* Update homeassistant/components/shelly/update.py

Co-authored-by: Shay Levy <levyshay1@gmail.com>

* simplify

* fix mypy

* Create test_update.py

* fix isort

* add progress support

* fix styling

* fix update_tests

* fix styling

* do not exclude shelly update test

* bring coverage to 100%

* snake case

* snake case

* change str(x) to cast(str, x)

* simplify tests

* further simplify tests

* Split MOCK_SHELLY_COAP and MOCK_SHELLY_RPC

* fix issort

* fix status test

* fix isort

* run python3 -m script.hassfest

Co-authored-by: Shay Levy <levyshay1@gmail.com>
2022-09-28 20:21:30 +03:00
Shay Levy
0d94324d58 Clean up Shelly async methods that are not awaiting (#72026) 2022-05-17 10:57:41 -07:00
Shay Levy
5359050afc Add Shelly gen2 error sensors (#66825) 2022-02-19 18:51:01 +02:00
epenet
dfdbeba7be Use entity_description in shelly block sensors (#64897)
* Use entity_description in shelly block sensors

* Re-order binary sensor

* Add async_added_to_hass for BlockSleepingBinarySensor

* Undo None

* Build description when restoring block attribute entities

* Move async_added_to_hass back to base class

Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-26 16:07:15 +02:00
epenet
076bc976ee Use entity_description in shelly rpc sensors (#64895)
* Use entity_description in shelly rpc sensors

* Enable None for binary sensor

* Adjust use_polling_wrapper

Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-25 15:48:51 +02:00
epenet
c8a63d4ffc Use entity_description in shelly rest sensors (#64843)
* Use entity_description in shelly rest sensors

* Use _attr_device_info

* Adjust _attr_unique_id and _attr_device_info

Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-24 19:43:43 +02:00
Marc Mueller
ae6d9c229e Use const imports [l-z] (#63469) 2022-01-05 18:21:20 +01:00
Robert Hillis
0cf0104662 Use enums in shelly (#62035) 2021-12-16 14:12:23 +01:00
Michael
90e52cd3ad Use relative imports [S-Z] (#61576) 2021-12-13 09:39:13 +01:00
Shay Levy
adfbcfa704 Add Shelly Gen1 beta_version attribute to firmware update sensor (#59359) 2021-11-08 21:47:01 +02:00
Michael
6a149706ab add constant CONF_SLEEP_PERIOD (#59195) 2021-11-06 17:32:58 +02:00
Shay Levy
e232bdc082 Add Shelly "installed version" extra state attribute to Gen2 firmware update sensor (#57722) 2021-10-14 19:02:37 -07:00
Maciej Bieniek
3127074f76 Add entity category to Shelly (#57705) 2021-10-14 15:17:00 -07:00
Shay Levy
c8dc5d15ee Fix: Shelly Gen2 - filter unsupported sensors (#57065) 2021-10-04 13:46:46 -07:00
Shay Levy
5249c89c3f Add Shelly RPC sensor and binary sensor platforms (#56253) 2021-09-17 15:53:39 +03:00
Shay Levy
8c3c2ad8e3 Updated changes for aioshelly 1.0.0 (#56083) 2021-09-11 00:48:55 +03:00
Matt Krasowski
fd66120d6d Handle incorrect values reported by some Shelly devices (#55042) 2021-08-29 14:52:12 +02:00
Maciej Bieniek
f1f05cdf1b Use DEVICE_CLASS_UPDATE in Shelly integration (#54746) 2021-08-17 11:57:45 +02:00
Maciej Bieniek
772cbd59d7 Improve typing in Shelly integration (#52544) 2021-07-21 10:11:44 -07:00
Erik Montnemery
14ff6d4d1f Update integrations p-s to override extra_state_attributes() (#47759) 2021-03-11 21:23:20 +01:00
Simone Chemelli
65a2f07a01 Fix missing Shelly external input (#47028)
* Add support for external input (Shelly 1/1pm add-on)

* Make external sensor naming consistent

* Fix case consistency
2021-02-25 09:51:18 +01:00
Shay Levy
0875f654c8 Add support for Shelly battery operated devices (#45406)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-02-03 17:03:22 +01:00