Commit Graph

305 Commits (dev)

Author SHA1 Message Date
Maciej Bieniek 56c53fdb9b
Allow Bluetooth proxy for Shelly devices only if Zigbee firmware is not active (#149193)
Co-authored-by: Shay Levy <levyshay1@gmail.com>
Co-authored-by: Norbert Rittel <norbert@rittel.de>
2025-07-24 21:14:44 +03:00
Maciej Bieniek c476500c49
Fix Shelly `n_current` sensor removal condition (#148740) 2025-07-14 23:40:46 +03:00
Maciej Bieniek 7ff90ca49d
Open repair issue when outbound WebSocket is enabled for Shelly non-sleeping RPC device (#147901) 2025-07-02 13:06:27 +02:00
Shay Levy 39abae36f0
Fix Shelly Block entity removal (#147694) 2025-06-28 22:40:58 +03:00
Shay Levy 2120ff6a0a
Fix Shelly entity removal (#147665) 2025-06-27 18:50:35 +03:00
Abílio Costa cefde21140
Update Shelly test snapshots (#147429) 2025-06-24 18:08:27 +03:00
Maciej Bieniek 438aa3486d
Add full device snapshot tests for Shelly (#145620) 2025-06-24 10:16:46 +02:00
Maciej Bieniek f7429f3431
Fix Shelly entity names for gen1 sleeping devices (#147019) 2025-06-20 15:19:39 +02:00
Shay Levy ab2fc4e9a6
Remove stale Shelly BLU TRV devices (#145994)
* Remove stale Shelly BLU TRV devices

* Add test

* Remove config entry from device
2025-06-11 17:39:49 +02:00
J. Nick Koston 3ecff19a45
Bump habluetooth to 3.49.0 (#146111)
* Bump habluetooth to 3.49.0

changelog: https://github.com/Bluetooth-Devices/habluetooth/compare/v3.48.2...v3.49.0

* update diag

* diag
2025-06-03 16:56:20 +02:00
epenet e4cc842584
Use async_load_json_(array/object)_fixture in async test functions (#145773) 2025-05-28 12:09:05 +02:00
Erik Montnemery 4e1d5fbeb0
Add WS command to help reset custom entity_id (#145504)
* Add WS command to help reset custom entity_id

* Calculate suggested object id from entity properties

* Fix logic and add additional tests

* Adjust test

* Update folder_watcher test

* Handle current entity id matches the automatic entity id

* Don't store calculated_object_id

* Update snapshots

* Update snapshots

* Update test

* Tweak logic for reusing current entity_id

* Improve test

* Don't assign same entity_id to several entities

* Prioritize custom entity name

* Update snapshots

* Update snapshots
2025-05-26 19:28:27 +02:00
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
Maciej Bieniek 46951bf223
Add `returned energy` sensor for Shelly RPC switch component (#145490)
* Add returned energy sensor for switch component

* Add test

* More tests

* Make returned energy sensor disabled by default
2025-05-25 16:16:55 +02:00
Simone Chemelli 484a547758
Fix pylance warning on SnapshotAssertion import (#145206) 2025-05-19 13:55:48 +02:00
Maciej Bieniek 92e570ffc1
Revert "Link Shelly device entry with Shelly BT scanner entry (#144626)" (#145177)
This reverts commit b15c9ad130.
2025-05-19 13:01:54 +03:00
Maciej Bieniek b15c9ad130
Link Shelly device entry with Shelly BT scanner entry (#144626)
* Add BT address to DeviceInfo.connections

* Cleaning

* Use bluetooth_source property

* Add test

* Add connections property
2025-05-13 07:19:07 +02:00
Maciej Bieniek fa1dc75517
Add repair flow for Shelly BLE scanner with unsupported firmware (#143850) 2025-04-30 15:43:07 +02:00
Maciej Bieniek ae3925118c
Do not allow to enable BT scanner for Shelly Gen4 device with Zigbee enabled (#143824)
* Bluetooth is not supported when Zigbee is enabled

* Update tests

* Format
2025-04-29 11:12:34 +03:00
Maciej Bieniek f1b3b0c155
Refactor tests for Shelly config flow (#143517)
* Add mock_setup_entry

* Add mock_setup

* Improve test_form_gen1_custom_port

* Improve test_form_errors_get_info

* Improve test_form_errors_test_connection

* Improve test_reconfigure_with_exception

* Improve test_form_auth_errors_test_connection_gen1

* Improve test_form_auth_errors_test_connection_gen2

* Cleaning

* Upate quality scale

* Always use result variable

* Remove unnecessary async_block_till_done
2025-04-26 13:00:45 +03:00
Maciej Bieniek 5b503f21d7
Abort Shelly flows if the device is not fully provisioned (#143652)
* Abort flows if the device is not fully provisioned

* Update tests
2025-04-25 10:37:58 +03:00
Maciej Bieniek 11f02e48d7
Use aioshelly method to set the target temperature for Shelly BLU TRV (#143504) 2025-04-23 18:37:29 +02:00
Maciej Bieniek b785d5297a
Use aioshelly methods with Shelly RPC text and select entities (#143464) 2025-04-22 22:07:05 -10:00
Maciej Bieniek 88821b1d0e
Use aioshelly methods with Shelly RPC number entities (#142482) 2025-04-22 12:44:02 +02:00
Simone Chemelli 44d6f0bc2b
Increase uptime deviation for Shelly (#142996)
* Increase uptime deviation for Shelly

* fix test

* make troubleshooting easy

* change deviation interval

* increase deviation to 1m
2025-04-16 14:02:27 +02:00
Maciej Bieniek 06a2de4d1c
Fix Shelly initialization if device runs large script (#142487)
* Don't check the whole script to see if it generates events

* Fix tests

---------

Co-authored-by: Shay Levy <levyshay1@gmail.com>
2025-04-08 20:53:44 -10:00
Maciej Bieniek 480d645650
Bump aioshelly to version 13.4.1 (#142477)
* Bymp aioshelly to 13.4.1

* Catch InvalidHostError

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2025-04-08 08:58:08 +02:00
Simone Chemelli f4fa4056ac
Make BT support detection dynamic for Shelly RPC devices (#137323) 2025-03-26 11:17:54 +01: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
Wouter 858f0e6657
Fixed issue where the device was already disconnected when setting up the event platform (#140722)
* Changed where the script events are collected to remove any device communication from async_setup_entry

* Implemented improvements and added a test to test whats happends when script_getcode fails

* Renamed script_events to rpc_script_event to make clear this is only for RPC devices

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

---------

Co-authored-by: Shay Levy <levyshay1@gmail.com>
2025-03-21 14:13:56 +02: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
Simone Chemelli 12f5bd2aea
Add dedicated sensors for extra_state_attributes in Shelly integration (#140793)
* Add dedicated sensors for extra_state_attributes in Shelly integration

* add tests

* apply review comment

* fix text syntax

* add gas test

* update strings

* add icons
2025-03-18 11:48:18 +01:00
Shay Levy 9b57a831f7
Fix Shelly Air lamp life sensor (#140799) 2025-03-17 17:33:11 +02:00
J. Nick Koston d69bcc02b0
Pass scanner mode to shelly Bluetooth scanner (#140689)
habluetooth will eventually be able to make better decisions
on how to route data based on the scanning mode.
2025-03-15 12:00:23 -10:00
Simone Chemelli 2fd91e7f9c
Remove unknown from Shelly sensor state (#140597) 2025-03-15 18:10:35 +01:00
Maciej Bieniek 5ea7c113b0
Use test snapshots for Shelly climate (#140582) 2025-03-14 11:15:38 +01:00
Maciej Bieniek fa57d57215
Fix Shelly diagnostics for devices without WebSocket Outbound support (#140501)
* Don't assume that `ws` is always in config

* Fix device
2025-03-13 20:58:09 +02:00
Simone Chemelli 03aff0d662
Use CONF_* const in Shelly tests (#140189) 2025-03-09 13:07:20 +01:00
J. Nick Koston d9d47f7203
Migrate shelly Bluetooth scanner to use correct MAC address (#140180) 2025-03-09 13:28:56 +02:00
Simone Chemelli 99b5adaef1
Cleanup add_to_hass method in Shelly tests (part 1) (#140075) 2025-03-07 23:04:49 +01:00
Simone Chemelli 366c5c3f10
Improve unique_id tests for Shelly block devices (#139778)
* Improve unique_id tests for Shelly block devices

* type test

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2025-03-04 14:03:38 -10:00
Simone Chemelli 13918f07d8
Switch cleanup for Shelly (part 2) (#138922)
* Switch cleanup for Shelly (part 2)

* apply review comment

* Update tests/components/shelly/test_climate.py

Co-authored-by: Maciej Bieniek <bieniu@users.noreply.github.com>

* apply review comments

---------

Co-authored-by: Maciej Bieniek <bieniu@users.noreply.github.com>
2025-03-01 22:39:19 +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
Shay Levy fb5af9acd0
Fix Shelly mock initialization for sleepy RPC device in tests (#139003) 2025-02-21 20:52:10 +02:00
Shay Levy 800f680bd5
Fix Shelly model name for xmod devices (#138984) 2025-02-21 09:53:43 -06:00
Simone Chemelli 901011de7b
Use xmod model info for Shelly XMOD devices (#137013) 2025-02-19 22:47:23 +01:00
J. Nick Koston 46599a4ac4
Bump habluetooth to 3.22.0 (#138812) 2025-02-18 23:50:11 -06:00
J. Nick Koston 8ae52cdc4c
Fix shelly not being able to be setup from user flow when already discovered (#138807)
raise_on_progress=False was missing in the user flow which
made it impossible to configure a shelly by IP when there
was an active discovery because the flow would abort
2025-02-18 22:05:05 +02:00
Erik Montnemery 4b34d1bbb5
Merge config subentry feature branch to dev (#136121)
* Reapply "Add support for subentries to config entries" (#133470) (#136061)

* Reapply "Add support for subentries to config entries" (#133470)

This reverts commit ecb3bf79f3.

* Update test snapshot

* Add config subentry support to device registry (#128157)

* Add config subentry support to device registry

* Apply suggestions from code review

* Update syrupy serializer

* Update snapshots

* Address review comments

* Allow a device to be connected to no or a single subentry of a config entry

* Update snapshots

* Revert "Allow a device to be connected to no or a single subentry of a config entry"

This reverts commit ec6f613151cb4a806b7961033c004b71b76510c2.

* Update test snapshots

* Bump release version in comments

* Rename config_subentries to config_entries_subentries

* Add config subentry support to entity registry (#128155)

* Add config subentry support to entity registry

* Update syrupy serializer

* Update snapshots

* Update snapshots

* Accept suggested changes

* Clean registries when removing subentry (#136671)

* Clean up registries when removing subentry

* Update tests

* Clean up subentries from deleted devices when removing config entry (#136669)

* Clean up subentries from deleted devices when removing config entry

* Move

* Add config subentry support to entity platform (#128161)

* Add config subentry support to entity platform

* Rename subentry_id to config_subentry_id

* Store subentry type in subentry (#136687)

* Add reconfigure support to config subentries (#133353)

* Add reconfigure support to config subentries

* Update test

* Minor adjustment

* Rename supported_subentry_flows to supported_subentry_types

* Address review comments

* Add subentry support to kitchen sink (#136755)

* Add subentry support to kitchen sink

* Add subentry reconfigure support to kitchen_sink

* Update kitchen_sink tests with subentry type stored in config entry

* Update kitchen_sink

* Update kitchen_sink

* Adjust kitchen sink tests

* Fix hassfest

* Apply suggestions from code review

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Improve docstrings and strings.json

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update snapshots

* Update snapshots

* Update snapshots

* Update snapshots

* Update snapshots

* Update snapshots

* Update snapshots

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2025-02-10 16:40:07 +01:00