I am trying to make a custom component to connect to a websocket server.
For this i was following : github
And i also read the docs.
However i still don’t really understand how it all works. I am using the DataUpdateCoordinate class to connect and then call async_set_updated_data(data) to update all entities but the callback functions of the entities are not called (checked with debugger).
Here is my code : code
You dont need the
async_added_to_hass(self) and complimentsry remove functions when using a coordinator, they are done for you. Not sure if this is causing your issue.
So i updated the code and as thought it didn’t fix it. Any other ideas?
So, your Illuminance sensor class should be inhertiting from SensorEntity and not Entity.
I am not clear why your Roler class is a coordinator entry. It would seem it shouldnt be and should just be a class to hold data?
Also, when you receive a message, it is definitelty json formatted, you are supressing any exceptions and i would recommend maybe raising the exception while testing to ensure no issue here.
EDIT: if that still doesnt sort it, I’ll download it and try and debug for you, if you can provide what the message data is that it would receive.
Thnx, after more testing and some tweaks as you mentioned it started to work.