From c70ca1572b6bb7080eac3f0d25ce67bdcc001ae8 Mon Sep 17 00:00:00 2001 From: Shay Levy Date: Fri, 30 Sep 2022 21:37:58 +0300 Subject: [PATCH] Make Shelly update sensors disabled by default (#79376) --- homeassistant/components/shelly/update.py | 4 ++-- tests/components/shelly/test_update.py | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/shelly/update.py b/homeassistant/components/shelly/update.py index fa37b394b6c..ac4b737a2cc 100644 --- a/homeassistant/components/shelly/update.py +++ b/homeassistant/components/shelly/update.py @@ -70,7 +70,7 @@ REST_UPDATES: Final = { install=lambda wrapper: wrapper.async_trigger_ota_update(), device_class=UpdateDeviceClass.FIRMWARE, entity_category=EntityCategory.CONFIG, - entity_registry_enabled_default=True, + entity_registry_enabled_default=False, ), "fwupdate_beta": RestUpdateDescription( name="Beta Firmware Update", @@ -94,7 +94,7 @@ RPC_UPDATES: Final = { install=lambda wrapper: wrapper.async_trigger_ota_update(), device_class=UpdateDeviceClass.FIRMWARE, entity_category=EntityCategory.CONFIG, - entity_registry_enabled_default=True, + entity_registry_enabled_default=False, ), "fwupdate_beta": RpcUpdateDescription( name="Beta Firmware Update", diff --git a/tests/components/shelly/test_update.py b/tests/components/shelly/test_update.py index 70c9b7a8e67..4d863c59390 100644 --- a/tests/components/shelly/test_update.py +++ b/tests/components/shelly/test_update.py @@ -1,7 +1,6 @@ """Tests for Shelly update platform.""" from homeassistant.components.shelly.const import DOMAIN -from homeassistant.components.update import DOMAIN as UPDATE_DOMAIN -from homeassistant.components.update.const import SERVICE_INSTALL +from homeassistant.components.update import DOMAIN as UPDATE_DOMAIN, SERVICE_INSTALL from homeassistant.const import ATTR_ENTITY_ID, STATE_ON, STATE_UNKNOWN from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_component import async_update_entity @@ -16,8 +15,8 @@ async def test_block_update(hass: HomeAssistant, coap_wrapper, monkeypatch): entity_registry.async_get_or_create( UPDATE_DOMAIN, DOMAIN, - "test_name_update", - suggested_object_id="test_name_update", + "test-mac-fwupdate", + suggested_object_id="test_name_firmware_update", disabled_by=None, ) hass.async_create_task( @@ -62,8 +61,8 @@ async def test_rpc_update(hass: HomeAssistant, rpc_wrapper, monkeypatch): entity_registry.async_get_or_create( UPDATE_DOMAIN, DOMAIN, - "test_name_update", - suggested_object_id="test_name_update", + "12345678-sys-fwupdate", + suggested_object_id="test_name_firmware_update", disabled_by=None, )