diff --git a/homeassistant/components/motion_blinds/__init__.py b/homeassistant/components/motion_blinds/__init__.py index f7ae6573b1b..a4fb003b546 100644 --- a/homeassistant/components/motion_blinds/__init__.py +++ b/homeassistant/components/motion_blinds/__init__.py @@ -3,8 +3,7 @@ from datetime import timedelta import logging from socket import timeout -from motionblinds import MotionMulticast -from motionblinds.motion_blinds import ParseException +from motionblinds import MotionMulticast, ParseException from homeassistant import config_entries, core from homeassistant.const import CONF_API_KEY, CONF_HOST, EVENT_HOMEASSISTANT_STOP @@ -40,7 +39,7 @@ class DataUpdateCoordinatorMotionBlinds(DataUpdateCoordinator): name, update_interval=None, update_method=None, - ): + ) -> None: """Initialize global data updater.""" super().__init__( hass, @@ -137,6 +136,11 @@ async def async_setup_entry( KEY_COORDINATOR: coordinator, } + if motion_gateway.firmware is not None: + version = f"{motion_gateway.firmware}, protocol: {motion_gateway.protocol}" + else: + version = f"Protocol: {motion_gateway.protocol}" + device_registry = await dr.async_get_registry(hass) device_registry.async_get_or_create( config_entry_id=entry.entry_id, @@ -145,7 +149,7 @@ async def async_setup_entry( manufacturer=MANUFACTURER, name=entry.title, model="Wi-Fi bridge", - sw_version=motion_gateway.protocol, + sw_version=version, ) hass.config_entries.async_setup_platforms(entry, PLATFORMS) diff --git a/homeassistant/components/motion_blinds/cover.py b/homeassistant/components/motion_blinds/cover.py index 60ec375a9c0..c96dff93e67 100644 --- a/homeassistant/components/motion_blinds/cover.py +++ b/homeassistant/components/motion_blinds/cover.py @@ -52,6 +52,7 @@ TILT_DEVICE_MAP = { BlindType.VenetianBlind: DEVICE_CLASS_BLIND, BlindType.ShangriLaBlind: DEVICE_CLASS_BLIND, BlindType.DoubleRoller: DEVICE_CLASS_SHADE, + BlindType.VerticalBlind: DEVICE_CLASS_BLIND, } TDBU_DEVICE_MAP = { diff --git a/homeassistant/components/motion_blinds/sensor.py b/homeassistant/components/motion_blinds/sensor.py index 9c6db5d88ec..194f0ae315c 100644 --- a/homeassistant/components/motion_blinds/sensor.py +++ b/homeassistant/components/motion_blinds/sensor.py @@ -40,11 +40,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities): class MotionBatterySensor(CoordinatorEntity, SensorEntity): - """ - Representation of a Motion Battery Sensor. - - Updates are done by the cover platform. - """ + """Representation of a Motion Battery Sensor.""" _attr_device_class = DEVICE_CLASS_BATTERY _attr_native_unit_of_measurement = PERCENTAGE @@ -91,11 +87,7 @@ class MotionBatterySensor(CoordinatorEntity, SensorEntity): class MotionTDBUBatterySensor(MotionBatterySensor): - """ - Representation of a Motion Battery Sensor for a Top Down Bottom Up blind. - - Updates are done by the cover platform. - """ + """Representation of a Motion Battery Sensor for a Top Down Bottom Up blind.""" def __init__(self, coordinator, blind, motor): """Initialize the Motion Battery Sensor."""