Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions homeassistant/components/matter/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ def _update_from_device(self) -> None:
platform=Platform.BINARY_SENSOR,
entity_description=MatterBinarySensorEntityDescription(
key="WindowCoveringConfigStatusOperational",
translation_key="config_status_operational",
device_class=BinarySensorDeviceClass.PROBLEM,
entity_category=EntityCategory.DIAGNOSTIC,
# unset Operational bit from ConfigStatus bitmap means problem
Expand Down
3 changes: 3 additions & 0 deletions homeassistant/components/matter/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
"boost_state": {
"name": "Boost state"
},
"config_status_operational": {
"name": "Configuration status"
},
"dishwasher_alarm_inflow": {
"name": "Inflow alarm"
},
Expand Down
8 changes: 4 additions & 4 deletions homeassistant/components/qwikswitch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
from homeassistant.helpers.dispatcher import async_dispatcher_send
from homeassistant.helpers.typing import ConfigType

_LOGGER = logging.getLogger(__name__)
from .const import DATA_QUIKSWITCH, DOMAIN

DOMAIN = "qwikswitch"
_LOGGER = logging.getLogger(__name__)

CONF_DIMMER_ADJUST = "dimmer_adjust"
CONF_BUTTON_EVENTS = "button_events"
Expand Down Expand Up @@ -96,7 +96,7 @@ def callback_value_changed(_qsd, qsid, _val):
if not await qsusb.update_from_devices():
return False

hass.data[DOMAIN] = qsusb
hass.data[DATA_QUIKSWITCH] = qsusb

comps: dict[Platform, list] = {
Platform.SWITCH: [],
Expand Down Expand Up @@ -168,7 +168,7 @@ def async_start(_):
@callback
def async_stop(_):
"""Stop the listener."""
hass.data[DOMAIN].stop()
hass.data[DATA_QUIKSWITCH].stop()

hass.bus.async_listen(EVENT_HOMEASSISTANT_STOP, async_stop)

Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/qwikswitch/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType

from . import DOMAIN
from .const import DATA_QUIKSWITCH, DOMAIN
from .entity import QSEntity

_LOGGER = logging.getLogger(__name__)
Expand All @@ -30,7 +30,7 @@ async def async_setup_platform(
if discovery_info is None:
return

qsusb = hass.data[DOMAIN]
qsusb = hass.data[DATA_QUIKSWITCH]
_LOGGER.debug("Setup qwikswitch.binary_sensor %s, %s", qsusb, discovery_info)
devs = [QSBinarySensor(sensor) for sensor in discovery_info[DOMAIN]]
add_entities(devs)
Expand Down
13 changes: 13 additions & 0 deletions homeassistant/components/qwikswitch/const.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""Support for Qwikswitch devices."""

from __future__ import annotations

from typing import TYPE_CHECKING

from homeassistant.util.hass_dict import HassKey

if TYPE_CHECKING:
from pyqwikswitch.async_ import QSUsb

DOMAIN = "qwikswitch"
DATA_QUIKSWITCH: HassKey[QSUsb] = HassKey(DOMAIN)
6 changes: 3 additions & 3 deletions homeassistant/components/qwikswitch/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity import Entity

from . import DOMAIN
from .const import DATA_QUIKSWITCH


class QSEntity(Entity):
Expand Down Expand Up @@ -67,8 +67,8 @@ def is_on(self):
async def async_turn_on(self, **kwargs):
"""Turn the device on."""
new = kwargs.get(ATTR_BRIGHTNESS, 255)
self.hass.data[DOMAIN].devices.set_value(self.qsid, new)
self.hass.data[DATA_QUIKSWITCH].devices.set_value(self.qsid, new)

async def async_turn_off(self, **_):
"""Turn the device off."""
self.hass.data[DOMAIN].devices.set_value(self.qsid, 0)
self.hass.data[DATA_QUIKSWITCH].devices.set_value(self.qsid, 0)
4 changes: 2 additions & 2 deletions homeassistant/components/qwikswitch/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType

from . import DOMAIN
from .const import DATA_QUIKSWITCH, DOMAIN
from .entity import QSEntity

_LOGGER = logging.getLogger(__name__)
Expand All @@ -28,7 +28,7 @@ async def async_setup_platform(
if discovery_info is None:
return

qsusb = hass.data[DOMAIN]
qsusb = hass.data[DATA_QUIKSWITCH]
_LOGGER.debug("Setup qwikswitch.sensor %s, %s", qsusb, discovery_info)
devs = [QSSensor(sensor) for sensor in discovery_info[DOMAIN]]
add_entities(devs)
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/qwikswitch/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType

from . import DOMAIN
from .const import DATA_QUIKSWITCH, DOMAIN
from .entity import QSToggleEntity


Expand All @@ -21,7 +21,7 @@ async def async_setup_platform(
if discovery_info is None:
return

qsusb = hass.data[DOMAIN]
qsusb = hass.data[DATA_QUIKSWITCH]
devs = [QSSwitch(qsid, qsusb) for qsid in discovery_info[DOMAIN]]
add_entities(devs)

Expand Down
Loading
Loading