New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Ezviz siren entity #93612
Add Ezviz siren entity #93612
Conversation
Hey there @BaQs, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
Final remarks. Please undraft when ready. |
This comment was marked as duplicate.
This comment was marked as duplicate.
self.coordinator.ezviz_client.sound_alarm, self._serial, 2 | ||
): | ||
self._attr_is_on = True | ||
evt.async_call_later(self.hass, OFF_DELAY, self.off_delay_listener) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if someone press turn on 30 seconds after the first on press?
Still going to turn off after the first 60 seconds or should you get a new 60 seconds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see it resets, have added logic to reset the event.
Thanks for asking.
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks @RenierM26 👍
* Initial commit * Add siren entity * Update coveragerc * Cleanup unused entity description. * Add restore and fix entity property to standards. * Schedule turn off to match camera firmware * Only add siren for devices that support capability * Removed unused attribute and import. * Add translation * Update camera.py * Update strings.json * Update camera.py * Cleanup * Update homeassistant/components/ezviz/siren.py Co-authored-by: G Johansson <goran.johansson@shiftit.se> * use description * Apply suggestions from code review Co-authored-by: G Johansson <goran.johansson@shiftit.se> * Update strings.json * Dont inherit coordinator class. * Add assumed state * Update homeassistant/components/ezviz/siren.py Co-authored-by: G Johansson <goran.johansson@shiftit.se> * Reset delay listener if trigered --------- Co-authored-by: G Johansson <goran.johansson@shiftit.se>
ir.async_create_issue( | ||
self.hass, | ||
DOMAIN, | ||
"service_depreciation_sound_alarm", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deprecation
self.async_write_ha_state() | ||
|
||
@callback | ||
def off_delay_listener(self, now: datetime) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't allow calculating state in Home Assistant for device integrating integrations. The device should update its state. Please move the update to the 3rd party library.
Proposed change
Add Ezviz siren entity.
EZVIZ calls this "Active Defence" and it could be a combination of Siren + Strobe or just a Strobe on some cameras.
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: