-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
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
octoprint platform causes error even though not in configuration #18627
Comments
Please double check you don't have octoprint in any of your binary_sensor:
- platform: octoprint
# ... will auto-load the octoprint component |
I think it's a bug in the component setup caused by the network discovery service (netdisco). We probably should add a guard clause that checks for domain key in config and returns if not found. |
I don't have octoprint anywhere in any of my files:
|
If you have discovery component activated it will trigger the octoprint component to load if an octoprint signature is found when scanning the network. Components can be excluded from discovery. But this is still a bug cause of the KeyError. |
I just ran into this issue after updating to 82.1 as well. Same deal, it's being detected under known_devices but I don't have it configured and get the KeyError. |
I upgrade from 0.79 to 0.84 and also get this error. I have Octoprint on the same network running on a raspberry pi but haven't set up the Octoprint component. I do have a switch that I named Octoprint, simple because it controls the power to that raspberry pi, but I sincerely hope that isn't the problem. Looking in the source code for the Discovery component I can indeed see that it looks for Octoprint but the information wasn't added to the Discovery doc. So I created a pull request to the Discovery doc for that. So of course I can, and have now, put octoprint on the ignore list for my Discovery component. For anyone looking to do the same, update your discovery configuration: I'm surely going to forget that -ignore pretty soon, propably before I set up the Octoprint component "sometime in the future". Will I still be able to use the Octoprint in the future with the discovery ignore config remaining there and instead configuring the host manually as per the component doc? |
Manual config should work. |
So in the pull request I was asked to say that the Octoprint component works in the Discovery component by adding it to the docs. I haven't used the component but it normally works with Discovery, right? |
No, discovery isn't really supported. There's just a debug message. We should remove the discovery listener or make it supported and fix the KeyError problem. |
According to a developer of Octoprint component home-assistant/core#18627 (comment)
According to a developer of Octoprint component home-assistant/core#18627 (comment)
According to a developer of Octoprint component home-assistant/core#18627 (comment)
Home Assistant release with the issue:
0.82.1
Last working Home Assistant release (if known):
Unknown
Operating environment (Hass.io/Docker/Windows/etc.):
Hass.io
Component/platform:
octoprint
Description of problem:
I do not have octoprint in my configuration, because I have no need to use Home Assistant to interface with octoprint, however I do have an octoprint server on my network.
The octoprint component in Home Assistant automatically detects my octoprint install and then reports a keyerror:
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/octoprint.py", line 95, in setup for printer in config[DOMAIN]: KeyError: 'octoprint'
The octoprint component should not report an error if I don't have it configured regardless of whether I happen to have an octoprint server on my network. I should not be forced to include a component that I don't want to use.
The desired behavior here would be for the component to show up in the "new integrations" portion of the "Configuration" instead of causing an error.
Problem-relevant
configuration.yaml
entries and (fill out even if it seems unimportant):I do not have octoprint in my configuration
Traceback (if applicable):
Additional information:
The text was updated successfully, but these errors were encountered: