From 5a69f9ed04b8a5074c489955b745eb27533a6313 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 15 Aug 2023 12:37:16 -0500 Subject: [PATCH] Remove unused code in enphase_envoy (#98474) --- homeassistant/components/enphase_envoy/binary_sensor.py | 2 -- homeassistant/components/enphase_envoy/select.py | 5 ----- homeassistant/components/enphase_envoy/sensor.py | 2 -- homeassistant/components/enphase_envoy/switch.py | 2 -- 4 files changed, 11 deletions(-) diff --git a/homeassistant/components/enphase_envoy/binary_sensor.py b/homeassistant/components/enphase_envoy/binary_sensor.py index 0e70a9fe98b..eae8c8628d5 100644 --- a/homeassistant/components/enphase_envoy/binary_sensor.py +++ b/homeassistant/components/enphase_envoy/binary_sensor.py @@ -112,8 +112,6 @@ async def async_setup_entry( coordinator: EnphaseUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id] envoy_data = coordinator.envoy.data assert envoy_data is not None - envoy_serial_num = config_entry.unique_id - assert envoy_serial_num is not None entities: list[BinarySensorEntity] = [] if envoy_data.encharge_inventory: entities.extend( diff --git a/homeassistant/components/enphase_envoy/select.py b/homeassistant/components/enphase_envoy/select.py index 75c9ce0cf7c..59f2a16e7cf 100644 --- a/homeassistant/components/enphase_envoy/select.py +++ b/homeassistant/components/enphase_envoy/select.py @@ -3,7 +3,6 @@ from __future__ import annotations from collections.abc import Callable from dataclasses import dataclass -import logging from typing import Any from pyenphase import EnvoyDryContactSettings @@ -19,8 +18,6 @@ from .const import DOMAIN from .coordinator import EnphaseUpdateCoordinator from .entity import EnvoyBaseEntity -_LOGGER = logging.getLogger(__name__) - @dataclass class EnvoyRelayRequiredKeysMixin: @@ -113,8 +110,6 @@ async def async_setup_entry( coordinator: EnphaseUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id] envoy_data = coordinator.envoy.data assert envoy_data is not None - envoy_serial_num = config_entry.unique_id - assert envoy_serial_num is not None entities: list[SelectEntity] = [] if envoy_data.dry_contact_settings: entities.extend( diff --git a/homeassistant/components/enphase_envoy/sensor.py b/homeassistant/components/enphase_envoy/sensor.py index 0e4a9b71232..0e0a2aacfd7 100644 --- a/homeassistant/components/enphase_envoy/sensor.py +++ b/homeassistant/components/enphase_envoy/sensor.py @@ -350,8 +350,6 @@ async def async_setup_entry( coordinator: EnphaseUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id] envoy_data = coordinator.envoy.data assert envoy_data is not None - envoy_serial_num = config_entry.unique_id - assert envoy_serial_num is not None _LOGGER.debug("Envoy data: %s", envoy_data) entities: list[Entity] = [ diff --git a/homeassistant/components/enphase_envoy/switch.py b/homeassistant/components/enphase_envoy/switch.py index 820b904e070..e0f211a1019 100644 --- a/homeassistant/components/enphase_envoy/switch.py +++ b/homeassistant/components/enphase_envoy/switch.py @@ -55,8 +55,6 @@ async def async_setup_entry( coordinator: EnphaseUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id] envoy_data = coordinator.envoy.data assert envoy_data is not None - envoy_serial_num = config_entry.unique_id - assert envoy_serial_num is not None entities: list[SwitchEntity] = [] if envoy_data.enpower: entities.extend(