Closed HeofHIShirts closed 3 years ago
Adding information about this bug, newly discovered: it only seems to happen when there is an element that comes before the sengledapi block in configuration.yaml that is formatted as a block, rather than as an include. If that element comes after the sengledapi block, the integration loads without issue or throwing an error. I don't know why this is the case, but so long as the sengledapi block is first, it's happy.
I dont think i understand. What do you mean by "so long as the sengledapi block is first?"
in configuration.yaml, if
sengledapi:
username: user@example.com
password: VERY-SECRET-PASSWORD
country: us
wifi: true
is the first text after all the standalone integrations and those with !includes after them (so, from default:config to timer: include !timers.yaml in this file), then the integration throws no errors and works as expected, regardless of what comes below the sengledapi block. But if, as in the configuration above, there's any element with indents, such as:
media_player:
platform: mpd
host: 192.168.XXX.XXX
name: Local Media Player
above the sengledapi code, then the integration fails to load and throws out errors that it's getting 'text/html' when it is expecting JSON.
Does that make things any clearer?
ETA: Or...not. I just tried to reproduce the error with a known good code with indent before the sengledapi code, and rather than throwing errors, Home Assistant smiled and booted all the integrations without any issues. It was probably a configuration error that was causing the issues, then, rather than the component itself.
Never mind, sorry about that.
Home Assistant does, however, ask me to let you know that
No 'version' key in the manifest file for custom integration 'sengledapi'. This will not be allowed in a future version of Home Assistant. Please report this to the maintainer of 'sengledapi'
So, in the next update, whenever it may be, we'll need a version key in the manifest.
Describe the bug The integration no longer works with Home Assistant OS
To Reproduce Restart Home Assistant from the console controls menu
Expected behavior Integration can control associated Sengled lights through hub
System configuration System: Home Assistant OS HA Version: 2021.3.4 SengledApi Version: v.0.2
configuration.yaml
home-assistant.log
Also, this same error {'Attempt to decode JSON with unexpected mimetype: text/html'') has happened at https://ucenter.cloud.sengled.com/user/app/customer/v2/AuthenCross.json in a failure. Here's the fuller logs from this new and different failure:
It looks like occasionally the integration is being sent HTML instead of JSON, perhaps, and that's causing an issue?
Thank you for maintaining the integration. It's very useful.