Commit Graph

136 Commits (d8e541a28439e7e91ced97de3a639da55c23abc1)

Author SHA1 Message Date
Maciej Bieniek 3aa6771835
Update `DeviceInfo.sw_version` value for Shelly Gen2 sleeping devices (#101338)
* Update device info for gen2 sleeping devices

* Add test

* Update sw_version only if the firmware_version value has changed

* Rename device_update_info() to update_device_fw_info()

* Remove duplicate comparison
2023-10-04 11:00:17 +02:00
Maciej Bieniek 5c5dff034c
Add `event` platform for Shelly gen1 devices (#100655)
* Initial commit

* Use description.key

* Add translations

* Check event_types

* Rename input_id to channel

* Fix removeal confition

* Add tests

* Sort classes and consts

* Use ShellyBlockEntity class

* Update tests

* Update homeassistant/components/shelly/event.py

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

---------

Co-authored-by: Shay Levy <levyshay1@gmail.com>
2023-09-23 16:03:57 +02:00
Shay Levy 439ca60cb6
Fix Shelly Gen2 event get input name method (#100733) 2023-09-23 12:45:41 +03:00
J. Nick Koston 0eca433004
Update zeroconf discovery to use IPAddress objects to avoid conversions (#100567) 2023-09-19 18:58:46 +02:00
Maciej Bieniek f6243a1f79
Add `event` platform for Shelly gen2 devices (#99659)
* Add event platform for gen2 devices

* Add tests

* Add removal condition

* Simplify RpcEventDescription; fix availability

* Improve names and docstrings

* Improve the event entity name

* Use async_on_remove()

* Improve tests coverage

* Improve tests coverage

* Prefix the entity name with the device name in the old way

* Black

* Use DeviceInfo object
2023-09-18 00:38:08 +02:00
Maciej Bieniek e1f4a3fa9f
Add energy meter sensors for Shelly Pro EM (#99747)
* Add support for Pro EM

* Improve get_rpc_channel_name()

* Revert an unintended change

* Add tests
2023-09-07 06:59:04 +02:00
Maciej Bieniek d9a1ebafdd
Show OTA update progress for Shelly gen2 devices (#99534)
* Show OTA update progress

* Use an event listener instead of a dispatcher

* Add tests

* Fix name

* Improve tests coverage

* Fix subscribe/unsubscribe logic

* Use async_on_remove()
2023-09-06 08:17:45 +02:00
Shay Levy b0f3b7bb76
Revert "Change naming of Shelly entities to correspond with HA guidelines" (#99059) 2023-08-28 10:42:24 +02:00
Erik Montnemery b0952bc54a
Use freezegun in shelly tests (#99042) 2023-08-25 09:06:43 -05:00
Shay Levy 406f06f0fc
Abort Shelly setup if MAC address mismatch (#98807) 2023-08-22 07:41:50 -05:00
Maciej Bieniek 17050a3286
Add support for Shelly Gas Valve addon (#98705)
* Support Gas Valve

* Treat opening and closing as open

* Use set_state()

* Change entity icon and name

* Add valve state sensor

* Closing == closed

* Add translations for valve state entity

* Valve state -> Valve status

* Add tests; use control_result

* Fix mypy error

* Add missing "valve" to the Mock

* Improve docstrings

* Fix climate platform tests

* Increase test coverage

* Add mising return
2023-08-22 11:53:52 +03:00
Maciej Bieniek f97f33fff7
Only create an issue if push updates fail 5 times in a row for Shelly gen1 devices (#98747) 2023-08-21 22:27:36 +02:00
Shay Levy a713d7585f
Bump aioshelly to 6.0.0 (#98719) 2023-08-21 10:49:11 +03:00
Maciej Bieniek c526d23686
Change naming of Shelly entities to correspond with HA guidelines (#97533)
* Do not use the device name to create the entity name

* Remove unnecessary return

* Fix mypy complains

* Gen1

* Uncapitalize description.name if channel name is used

* Fix for climate and button

* switch_3 -> switch 3

* Add _attr_has_entity_name to ShellyRestAttributeEntity

* Capitalize channel name
2023-08-19 11:13:22 +02:00
Franck Nijhof 868a5f377f
Ruff: isort don't split imports based on trailing comma (#98162) 2023-08-10 14:27:03 +02:00
Maciej Bieniek 2e156e56bf
Create an issue if Shelly TRV is not calibrated (#96952)
* Create issue if Shelly Valve is not calibrated

* Add test

* Improve test

* Improve issue description

* Restart -> reboot
2023-07-21 14:20:03 +02:00
Maciej Bieniek db83dc9acc
Create an issue if push updates fail for Shelly gen1 devices (#96910)
* Create an issue if push updates fail

* Improve strings

* Delete the issue when reloading configuration entry

* Change MAX_PUSH_UPDATE_FAILURES to 5

* Improve issue strings

* Add test

* Use for

* Update homeassistant/components/shelly/strings.json

Co-authored-by: Charles Garwood <cgarwood@newdealmultimedia.com>

* Simplify deleting the issue

---------

Co-authored-by: Charles Garwood <cgarwood@newdealmultimedia.com>
2023-07-20 13:11:05 +02: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
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 8d6a711cac
Make `unique_id` of the Shelly button entity immutable (#95160) 2023-06-27 19:10:12 +02:00
Maciej Bieniek 05039036f1
Add compatibility with sleeping Shelly gen2 devices with firmware 1.0.0 (#94864) 2023-06-21 12:01:17 +02:00
Erik Montnemery eba04824a4
Replace assert_lists_same with pytest_unordered in integrations n-s (#94902) 2023-06-20 20:23:14 +02:00
Maciej Bieniek 7b3f100efb
Catch InvalidAuthError in `shutdown()` method for Shelly gen2 devices (#94563)
* Catch InvalidAuthError in shutdown() method

* Add test

* Revert unwanted change in tests
2023-06-15 00:00:21 +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
Ville Skyttä 940942a74a
Import `util.dt` as `dt_util` in `components/[p-s]*` (#93761) 2023-05-30 00:09:42 +03:00
Marvin Wichmann 795ef075da
Restore original websocket commands for config entries (#93707)
Restore original websocket commands and add "config_entries/get_single"
2023-05-28 21:40:35 -04:00
Maciej Bieniek eb058a3d41
Add illuminance sensor for Shelly gen2 devices (#93559) 2023-05-25 23:10:44 +02:00
Erik Montnemery b754f03eb1
Add WS command for getting a config entry (#93387)
* Add WS command for getting a config entry

* Update tests
2023-05-23 10:44:02 +02:00
J. Nick Koston 99b58f157e
Bump PyJWT to 2.6.0 (#90134)
* Bump PyJWT to 2.6.0

* fix time being frozen too late which makes the access token creation time in the future

* revert zha change

* fix repairs test

* fix ical test
2023-03-22 20:00:47 -04:00
epenet a102883eff
Add type hints to integration tests (part 2) (#88493) 2023-02-21 09:25:05 +01:00
Maciej Bieniek 7119a0f811
Use `suggested_display_precision` instead of rounding in Shelly sensor platform (#87084) 2023-02-20 10:20:52 -06:00
epenet 80ee196fd8
Add type hints to integration tests (part 19) (#88178) 2023-02-15 18:07:40 +01:00
Franck Nijhof ed79265843
Enable Ruff PT006 (#88165)
* Enable Ruff PT006

* Adjust existing cases

* Fix tests

* Remove unneeded parentheses
2023-02-15 14:09:50 +01:00
Maciej Bieniek 95bb019f71
Do not reload Shelly TRV entry when not needed (#88037)
* Do not reload the entry when the target temperature changes

* Do not reload the entry when the mode changes

* Increase test coverage

* Increase test coverage
2023-02-15 10:21:53 +01:00
Maciej Bieniek cd4ce86f07
Add support for `triple_push` event for Shelly gen2 devices (#88081)
* Add support for triple_push event

* Sort

* Fix tests
2023-02-15 10:20:27 +01:00
epenet ba85fdcd61
Add type hints to integration tests (q-s) (#87706) 2023-02-08 08:12:54 -08:00
epenet aa00114c2f
Add return type to async tests without arguments (#87612) 2023-02-07 10:26:56 +01:00
epenet a79be493e5
Adjust hass_client type hint in integration tests (#86954)
* Adjust hass_client type hint in integration tests

* Adjust hass_client_no_auth

* Fix rebase
2023-02-02 16:29:57 -05:00
Franck Nijhof 5e81d28116
Update black to 23.1.0 (#87188) 2023-02-02 18:35:24 +01:00
Shay Levy 857df05308
Add Shelly Gen2 update entity for sleeping devices (#86837) 2023-01-30 19:05:13 +02: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 f9f9741d2a
Separate Shelly tests parameters in parametrize (#86778)
Shelly tests - separate parameters in parametrize
2023-01-27 14:28:35 +01:00
Shay Levy ae6bc96002
Shelly code quality (#86733) 2023-01-27 10:47:05 +02:00
Franck Nijhof e50a531cd9
Code styling tweaks to the tests - Part 2 (#86662)
Co-authored-by: jjlawren <jjlawren@users.noreply.github.com>
2023-01-26 01:23:53 +01:00
Maciej Bieniek 9a68f0abe8
Store Shelly climate `last_target_temp` value in restore extra data (#86482)
fixes undefined
2023-01-24 07:28:34 -10:00
Shay Levy 9e4be56939
Shelly - handle None in RPC power sensors (#86399)
Handle None in RPC power sensors
2023-01-22 22:18:47 +02:00
Shay Levy d5797d9f7d
Cleanup Shelly imports (#86359)
* Cleanup Shelly imports

* Cleanup tests
2023-01-22 01:26:54 +02:00
Shay Levy df77646c8a
Fix Shelly sleeping Gen2 - do not refresh from zeroconf discovery (#86296) 2023-01-20 21:27:31 +02:00
J. Nick Koston d949f51f10
Handle ignored shelly entries when discovering via zeroconf (#86039)
fixes https://github.com/home-assistant/core/issues/85879
2023-01-16 11:21:49 -10:00
J. Nick Koston 2c95c0b3a1
Do not check ble scanner state for sleepy shelly devices (#85566)
fixes #85563
2023-01-10 00:16:14 +02:00