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
4 changes: 2 additions & 2 deletions homeassistant/components/homematicip_cloud/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
from homeassistant.core import HomeAssistant

from . import DOMAIN as HMIPC_DOMAIN, HMIPC_HAPID, HomematicipGenericDevice
from .device import ATTR_GROUP_MEMBER_UNREACHABLE, ATTR_MODEL_TYPE
from .device import ATTR_GROUP_MEMBER_UNREACHABLE, ATTR_IS_GROUP, ATTR_MODEL_TYPE

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -312,7 +312,7 @@ def available(self) -> bool:
@property
def device_state_attributes(self):
"""Return the state attributes of the security zone group."""
state_attr = {ATTR_MODEL_TYPE: self._device.modelType}
state_attr = {ATTR_MODEL_TYPE: self._device.modelType, ATTR_IS_GROUP: True}

for attr, attr_key in GROUP_ATTRIBUTES.items():
attr_value = getattr(self._device, attr, None)
Expand Down
3 changes: 3 additions & 0 deletions homeassistant/components/homematicip_cloud/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

ATTR_MODEL_TYPE = "model_type"
ATTR_ID = "id"
ATTR_IS_GROUP = "is_group"
# RSSI HAP -> Device
ATTR_RSSI_DEVICE = "rssi_device"
# RSSI Device -> HAP
Expand Down Expand Up @@ -131,4 +132,6 @@ def device_state_attributes(self):
if attr_value:
state_attr[attr_key] = attr_value

state_attr[ATTR_IS_GROUP] = False

return state_attr
6 changes: 3 additions & 3 deletions homeassistant/components/homematicip_cloud/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from homeassistant.core import HomeAssistant

from . import DOMAIN as HMIPC_DOMAIN, HMIPC_HAPID, HomematicipGenericDevice
from .device import ATTR_MODEL_TYPE
from .device import ATTR_IS_GROUP, ATTR_MODEL_TYPE

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -150,8 +150,8 @@ def unit_of_measurement(self) -> str:

@property
def device_state_attributes(self):
"""Return the state attributes of the security zone group."""
return {ATTR_MODEL_TYPE: self._device.modelType}
"""Return the state attributes of the access point."""
return {ATTR_MODEL_TYPE: self._device.modelType, ATTR_IS_GROUP: False}
Comment thread
SukramJ marked this conversation as resolved.


class HomematicipHeatingThermostat(HomematicipGenericDevice):
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/homematicip_cloud/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from homeassistant.core import HomeAssistant

from . import DOMAIN as HMIPC_DOMAIN, HMIPC_HAPID, HomematicipGenericDevice
from .device import ATTR_GROUP_MEMBER_UNREACHABLE
from .device import ATTR_GROUP_MEMBER_UNREACHABLE, ATTR_IS_GROUP

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -113,7 +113,7 @@ def available(self) -> bool:
@property
def device_state_attributes(self):
"""Return the state attributes of the switch-group."""
state_attr = {}
state_attr = {ATTR_IS_GROUP: True}
if self._device.unreach:
state_attr[ATTR_GROUP_MEMBER_UNREACHABLE] = True
return state_attr
Expand Down