mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Address MyStrom late review (#102306)
* Address MyStrom late review * Address MyStrom late review
This commit is contained in:
parent
f4e7c5aed3
commit
fd435a5416
@ -16,7 +16,7 @@ from homeassistant.exceptions import ConfigEntryNotReady
|
|||||||
from .const import DOMAIN
|
from .const import DOMAIN
|
||||||
from .models import MyStromData
|
from .models import MyStromData
|
||||||
|
|
||||||
PLATFORMS_PLUGS = [Platform.SWITCH, Platform.SENSOR]
|
PLATFORMS_PLUGS = [Platform.SENSOR, Platform.SWITCH]
|
||||||
PLATFORMS_BULB = [Platform.LIGHT]
|
PLATFORMS_BULB = [Platform.LIGHT]
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
@ -43,7 +43,6 @@ def _get_mystrom_switch(host: str) -> MyStromSwitch:
|
|||||||
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||||
"""Set up myStrom from a config entry."""
|
"""Set up myStrom from a config entry."""
|
||||||
host = entry.data[CONF_HOST]
|
host = entry.data[CONF_HOST]
|
||||||
device = None
|
|
||||||
try:
|
try:
|
||||||
info = await pymystrom.get_device_info(host)
|
info = await pymystrom.get_device_info(host)
|
||||||
except MyStromConnectionError as err:
|
except MyStromConnectionError as err:
|
||||||
|
@ -64,7 +64,6 @@ class MyStromSwitchSensor(SensorEntity):
|
|||||||
"""Representation of the consumption or temperature of a myStrom switch/plug."""
|
"""Representation of the consumption or temperature of a myStrom switch/plug."""
|
||||||
|
|
||||||
entity_description: MyStromSwitchSensorEntityDescription
|
entity_description: MyStromSwitchSensorEntityDescription
|
||||||
device: MyStromSwitch
|
|
||||||
|
|
||||||
_attr_has_entity_name = True
|
_attr_has_entity_name = True
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user