I’m trying to hide unconfigured alarm panel areas (the actual real panel can have 8 areas/partitions each with it’s own zones and keypads acting as virtual separate alarms panels) by setting the hidden state to True. This worked for unconfigured alarm zones, but not the actual panels.
This works:
class ElkSensorDevice(Entity):
...
@property
def device_state_attributes(self):
"""Return the state attributes of the sensor."""
return {
'Status' : self._zone.status(),
'State' : self._zone.state(),
'Alarm' : self._zone.alarm(),
'Definition' : self._zone.definition(),
'friendly_name' : self._zone.description(),
'hidden' : self._hidden
}
This doesn’t
class ElkAreaDevice(alarm.AlarmControlPanel):
...
@property
def device_state_attributes(self):
"""Return the state attributes of the sensor."""
return {
'hidden' : self._hidden,
'Readiness' : self._area.arm_up(),
'Status' : self._area.status(),
'State' : self._state,
'Alarm' : self._area.alarm(),
'friendly_name' : self._area.description(),
}
Specifically, all those other attributes show up in the States screen, but hidden doesn’t show for the alarm panels and thus the areas that aren’t configured which I am setting hidden to True for are still showing up on the default view.
I even tried using this:
@property
def hidden(self) -> bool:
return self._hidden
And still hidden doesn’t appear as an attribute for the alarm panel.
I don’t see any obvious point in the code where this would get removed from the attribute set for alarm panels (looking at homeassistant.components.alarm_control_panel and homeassistant.helpers.entity).
Here’s the JSON as it appears in the States page in HASS:
Zone:
{
"Status": "Normal",
"State": "Unconfigured",
"icon": "mdi:",
"Alarm": "Disabled",
"Definition": "Disabled",
"friendly_name": "Zone 144",
"hidden": true
}
Alarm panel:
{
"Status": "Disarmed",
"code_format": "[0-9]{4}([0-9]{2})?",
"State": "disarmed",
"Readiness": "Ready To Arm",
"Alarm": "No Alarm Active",
"friendly_name": "Area 3",
"changed_by": null
}