Add icon translations to Modern Forms (#111933)
* Add icon translations to Modern Forms * Add icon translations to Modern Forms
This commit is contained in:
parent
fbb982f8ce
commit
4ae7102f63
9 changed files with 38 additions and 26 deletions
|
@ -1,7 +1,6 @@
|
|||
"""Tests for the Modern Forms sensor platform."""
|
||||
from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR_DOMAIN
|
||||
from homeassistant.components.modern_forms.const import DOMAIN
|
||||
from homeassistant.const import ATTR_ICON
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import entity_registry as er
|
||||
|
||||
|
@ -37,11 +36,9 @@ async def test_binary_sensors(
|
|||
# Light timer remaining time
|
||||
state = hass.states.get("binary_sensor.modernformsfan_light_sleep_timer_active")
|
||||
assert state
|
||||
assert state.attributes.get(ATTR_ICON) == "mdi:av-timer"
|
||||
assert state.state == "off"
|
||||
|
||||
# Fan timer remaining time
|
||||
state = hass.states.get("binary_sensor.modernformsfan_fan_sleep_timer_active")
|
||||
assert state
|
||||
assert state.attributes.get(ATTR_ICON) == "mdi:av-timer"
|
||||
assert state.state == "off"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
from datetime import datetime
|
||||
|
||||
from homeassistant.components.sensor import SensorDeviceClass
|
||||
from homeassistant.const import ATTR_DEVICE_CLASS, ATTR_ICON
|
||||
from homeassistant.const import ATTR_DEVICE_CLASS
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from . import init_integration, modern_forms_timers_set_mock
|
||||
|
@ -21,14 +21,12 @@ async def test_sensors(
|
|||
# Light timer remaining time
|
||||
state = hass.states.get("sensor.modernformsfan_light_sleep_time")
|
||||
assert state
|
||||
assert state.attributes.get(ATTR_ICON) == "mdi:timer-outline"
|
||||
assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.TIMESTAMP
|
||||
assert state.state == "unknown"
|
||||
|
||||
# Fan timer remaining time
|
||||
state = hass.states.get("sensor.modernformsfan_fan_sleep_time")
|
||||
assert state
|
||||
assert state.attributes.get(ATTR_ICON) == "mdi:timer-outline"
|
||||
assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.TIMESTAMP
|
||||
assert state.state == "unknown"
|
||||
|
||||
|
@ -44,13 +42,11 @@ async def test_active_sensors(
|
|||
# Light timer remaining time
|
||||
state = hass.states.get("sensor.modernformsfan_light_sleep_time")
|
||||
assert state
|
||||
assert state.attributes.get(ATTR_ICON) == "mdi:timer-outline"
|
||||
assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.TIMESTAMP
|
||||
datetime.fromisoformat(state.state)
|
||||
|
||||
# Fan timer remaining time
|
||||
state = hass.states.get("sensor.modernformsfan_fan_sleep_time")
|
||||
assert state
|
||||
assert state.attributes.get(ATTR_ICON) == "mdi:timer-outline"
|
||||
assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.TIMESTAMP
|
||||
datetime.fromisoformat(state.state)
|
||||
|
|
|
@ -7,7 +7,6 @@ import pytest
|
|||
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
|
||||
from homeassistant.const import (
|
||||
ATTR_ENTITY_ID,
|
||||
ATTR_ICON,
|
||||
SERVICE_TURN_OFF,
|
||||
SERVICE_TURN_ON,
|
||||
STATE_OFF,
|
||||
|
@ -31,7 +30,6 @@ async def test_switch_state(
|
|||
|
||||
state = hass.states.get("switch.modernformsfan_away_mode")
|
||||
assert state
|
||||
assert state.attributes.get(ATTR_ICON) == "mdi:airplane-takeoff"
|
||||
assert state.state == STATE_OFF
|
||||
|
||||
entry = entity_registry.async_get("switch.modernformsfan_away_mode")
|
||||
|
@ -40,7 +38,6 @@ async def test_switch_state(
|
|||
|
||||
state = hass.states.get("switch.modernformsfan_adaptive_learning")
|
||||
assert state
|
||||
assert state.attributes.get(ATTR_ICON) == "mdi:school-outline"
|
||||
assert state.state == STATE_OFF
|
||||
|
||||
entry = entity_registry.async_get("switch.modernformsfan_adaptive_learning")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue