Closed lrusdorf closed 9 months ago
thx @lrusdorf @gluap: can this be integrated ? Would be great since I have a 9478 sun sensor. Can't test it at the moment since the sun itself has to solar charge the battery of the 9478, waiting for sunny days. :-D
@lrusdorf Thank you, having contributions like this is what makes it possible to enable device types I don't have in duofern-hacs.
Could you phrase this as a pull request or (if that is easier) possibly attach the python file? Pasting it into the comment has messed with the indentation.
@gluap Thanks for having done all the pre-work ;-) I just had to extend your basis. Yes, let me attach the file ... I am new to contributing to GitHub, so I am not yet used to how to do it. Sorry. I also do have a "Handzentrale" (9493, identifier E0), but don't yet know what to do with it within HA, so haven't done any investigations yet. Ideas are welcome.
@lrusdorf the new pre-release contains your code (slightly adapted to merge with #28). The normal procedure here would be a pull request, but as it was only one file sending that via attachement requires less work and reading up on procedure on your part.
code was added
Hi, I have extended the binary_sensor.py to discover the sun sensor 9478 and add it as a light sensor. Working fine with mine. Feel free to include in build.
Add class Light:
from homeassistant.components.binary_sensor import ( DEVICE_CLASS_SMOKE, DEVICE_CLASS_LIGHT, PLATFORM_SCHEMA, BinarySensorEntity )
In the device detection loop the device ID is "a5":
def setup_platform(hass, config, add_entities, discovery_info=None): """Setup the Duofern binary sensors pltaform"""
and the Class is defined as: class DuofernSunSensor(BinarySensorEntity): """Duofern sun sensor entity"""