Closed OleksandrBerchenko closed 5 years ago
@tfriedel FYI: https://github.com/home-assistant/home-assistant/pull/21176
@tfriedel Hi! Could you please comment in https://github.com/home-assistant/home-assistant/pull/21176 that you also tested those changes? Maybe that could speed up the reviewing process :)
Thanks!
right, that seems stuck atm unfortunately. maybe I have to check what's going on with the log messages first
Am Sa., 9. März 2019 um 10:28 Uhr schrieb OleksandrBerchenko < notifications@github.com>:
@tfriedel https://github.com/tfriedel Hi! Could you please comment in home-assistant/home-assistant#21176 https://github.com/home-assistant/home-assistant/pull/21176 that you also tested those changes? Maybe that could speed up the reviewing process :)
Thanks!
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tfriedel/python-lightify/pull/17#issuecomment-471161521, or mute the thread https://github.com/notifications/unsubscribe-auth/ABu6xnmEi-MeMGYsaLas3Zs88jijZLioks5vU37HgaJpZM4a_FTe .
@tfriedel It looks like the issue exists only if it's installed as a custom component + there is no logging configuration in configuration.yaml
(and we rely on some default values). Well, I didn't try it as a custom component (because it's not going to be a "custom component" :) ), but I suspect that custom components ignore Home Assistant default (WARNING
) and use their own defaults (DEBUG
in our case). To be honest, I don't see a problem here. Maybe I'm wrong.
Thanks!
ok I don't understand this completely yet, but I wonder why we have DEBUG as default. can we fix this easily by changing the default to WARNING as well?
Am Sa., 9. März 2019 um 11:46 Uhr schrieb OleksandrBerchenko < notifications@github.com>:
@tfriedel https://github.com/tfriedel It looks like the issue exists only if it's installed as a custom component + there is no logging configuration in configuration.yaml (and we rely on some default values). Well, I didn't try it as a custom component (because it's not going to be a "custom component" :) ), but I suspect that custom components ignore Home Assistant default (WARNING) and use their own defaults (DEBUG in our case). To be honest, I don't see a problem here. Maybe I'm wrong.
Thanks!
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tfriedel/python-lightify/pull/17#issuecomment-471166328, or mute the thread https://github.com/notifications/unsubscribe-auth/ABu6xuJt7oCitxRzPE9mmcMROaVTXJvgks5vU5D1gaJpZM4a_FTe .
@tfriedel As far as I observe, if I set it to WARNING
, it won't be possible to change it to INFO
or DEBUG
in Home Assistant (only to ERROR
). If I set it to DEBUG
, in Home Assistant I can now set any level like:
logger:
default: info
or
logger:
default: warning
logs:
lightify: debug
Also see https://github.com/home-assistant/home-assistant/pull/21176#issuecomment-466485696 .
Thanks!
I did copy over osramlightify.py the old and manually upgraded lightify and logging worked with the snippets you posted. Also when no "logger:" config was present, it was not defaulting to debug. I'm not sure if it is good that we configure "lightify" and not something like homeassistant.components.light or homeassistant.components.light.osramlightify. I have no idea how this is like in other components.
I could reproduce @SukramJ 's problem, that with a fresh home assistant installation and osramlightify as a custom component the default logging level for lightify was debug. Not only that, after I reproduced this problem I moved it from custom_components over the old one. I expected the problem would not appear then. But it appeared there too. So in summary, logging is broken and needs to be fixed. I'm not sure how. Is there a guide or requirements? Or some other custom component that uses an external library with logging for inspiration?
turns out it is easier to fix then I thought. in osramlightify change logging.DEBUG to logging.NOTSET . it fixed all the problems.
@tfriedel Wow, never tried that. I will double check and apply a fix.
Thanks!
All unknown lamps are still treated as RGBW.
I have also reordered DeviceSubType (while it's not too late): it's more likely to get new sensor types than new switches.