Add HomematicIP alarm control panel#15342
Add HomematicIP alarm control panel#15342MartinHjelmare merged 6 commits intohome-assistant:devfrom worm-ee:add-homematicip_cloud-alarm_panel
Conversation
|
|
||
|
|
||
| async def async_setup_entry(hass, config_entry, async_add_devices): | ||
| """Set up the HomematicIP climate from a config entry.""" |
| def state(self): | ||
| """Return the state of the device.""" | ||
| if (self._device.sabotage or self._device.motionDetected or | ||
| self._device.windowState == HMIP_OPEN): |
There was a problem hiding this comment.
How do we know that the alarm was armed here, ie that we should trigger on motion or opened window?
| @property | ||
| def device_state_attributes(self): | ||
| """Return the state attributes of the alarm control device.""" | ||
| return {} |
There was a problem hiding this comment.
If this is needed to not return the parent class device attributes, please add a comment about that here and return None instead.
| @property | ||
| def device_state_attributes(self): | ||
| """Return the state attributes of the alarm control device.""" | ||
| return None |
There was a problem hiding this comment.
Please add a code comment why we need to overwrite this property and return None. This would look weird not knowing about the parent class implementation.
| @property | ||
| def device_state_attributes(self): | ||
| """Return the state attributes of the alarm control device.""" | ||
| "The base class is loading the battery proprety, but device doesnt" |
There was a problem hiding this comment.
Python comments are written like this, ie starting with a hash sign:
# This is a comment.There was a problem hiding this comment.
Sorry... I was distracted.
| @property | ||
| def device_state_attributes(self): | ||
| """Return the state attributes of the alarm control device.""" | ||
| # The base class is loading the battery proprety, but device doesnt |
There was a problem hiding this comment.
proprety -> property
doesnt -> doesn't
MartinHjelmare
left a comment
There was a problem hiding this comment.
Great!
Can be merged when build passes.
* Add HomematicIP security zone * Update access point tests * Fix state if not armed and coments * Add comment for the empty state_attributes * Fix comment * Fix spelling
Description:
Add support for HomematicIP security zone into alarm control panel
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#5670
Checklist:
tox. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools: