Skip to content

Distinguish RGB and RGBW lamps - #17

Merged
tfriedel merged 2 commits into
tfriedel:masterfrom
OleksandrBerchenko:master
Feb 16, 2019
Merged

tfriedel merged 2 commits into
tfriedel:masterfrom
OleksandrBerchenko:master

Conversation

@OleksandrBerchenko

Copy link
Copy Markdown

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.

@OleksandrBerchenko

Copy link
Copy Markdown
Author

@OleksandrBerchenko

Copy link
Copy Markdown
Author

@tfriedel Hi! Could you please comment in home-assistant/core#21176 that you also tested those changes? Maybe that could speed up the reviewing process :)

Thanks!

@tfriedel

tfriedel commented Mar 9, 2019 via email

Copy link
Copy Markdown
Owner

@OleksandrBerchenko

Copy link
Copy Markdown
Author

@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!

@tfriedel

tfriedel commented Mar 9, 2019 via email

Copy link
Copy Markdown
Owner

@OleksandrBerchenko

Copy link
Copy Markdown
Author

@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 home-assistant/core#21176 (comment) .

Thanks!

@tfriedel

Copy link
Copy Markdown
Owner

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?

@tfriedel

Copy link
Copy Markdown
Owner

turns out it is easier to fix then I thought.
in osramlightify change logging.DEBUG to logging.NOTSET . it fixed all the problems.

@OleksandrBerchenko

Copy link
Copy Markdown
Author

@tfriedel Wow, never tried that. I will double check and apply a fix.

Thanks!

@OleksandrBerchenko

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants