dahlb / hatch_rest_api Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Describe the bug
Entities in Home Assistant didn't report unavailable but no interactions worked. Wasn't running debug logs :(
To Reproduce
Unknown. Maybe my token expired?
Expected behavior
Devices continue to work without needing a HA reboot.
Screenshots
None
Additional context
Also noticed the wifi sensor stated disconnected so some sensors got created but some of the entities failed to function specifically the media player.
Did look at full log but noticed this.
Logger: homeassistant.components.media_player
Source: custom_components/ha_hatch/riot_media_entity.py:48
Integration: Media player (documentation, issues)
First occurred: January 22, 2023 at 9:04:49 PM (4 occurrences)
Last logged: January 22, 2023 at 9:09:10 PM
Error adding entities for domain media_player with platform ha_hatch
Error while setting up ha_hatch platform for media_player
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 438, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 709, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 803, in add_to_platform_finish
await self.async_added_to_hass()
File "/config/custom_components/ha_hatch/rest_entity.py", line 52, in async_added_to_hass
self._update_local_state()
File "/config/custom_components/ha_hatch/riot_media_entity.py", line 48, in _update_local_state
_LOGGER.debug(f"updating state:{self.rest_device}")
File "/usr/local/lib/python3.10/site-packages/hatch_rest_api/riot.py", line 120, in __str__
return f"{self.__repr__()}"
File "/usr/local/lib/python3.10/site-packages/hatch_rest_api/riot.py", line 113, in __repr__
"is_clock_on": self.is_clock_on,
File "/usr/local/lib/python3.10/site-packages/hatch_rest_api/riot.py", line 136, in is_clock_on
return self.flags & RIOT_FLAGS_CLOCK_ON
TypeError: unsupported operand type(s) for &: 'NoneType' and 'int'
Hi,
Would be great if there was a simple example on how to use the package to make requests against the Hatch Rest.
Thanks,
M.
I work at Hatch. We are being alerted by our production systems of some possible bugs in your project. MQTT client connection attempts are being throttled by AWS:
AWS have strict limits on the number of connection attempts from a single client id:
https://docs.aws.amazon.com/general/latest/gr/iot-core.html
https://docs.aws.amazon.com/iot/latest/developerguide/metrics_dimensions.html
From the Cloudwatch graph, it looks like connect requests are coming in at over 1/second, resulting in ClientIdThrottle events (resulting in my pager going off during the night :-)
I hope you can track down this bug and prevent the code from issuing so many client connection requests to MQTT.
Is your feature request related to a problem? Please describe.
I'd like to use this library and associated custom component with the gen 2 hatch products
Describe the solution you'd like
I have created Home Assistant integrations and their backing libraries in the past (several years back) but have very little experience with async/newer Home Assistant integrations so would like to see if we could get this support added together.
Do you have/or could you create a guide on how I might go about using this library to investigate what might be needed? For example, is there a testing script that could be added that would allow manually interacting with this library and the hatch API? I tried manually installed this library and importing from hatch_rest_api import get_rest_devices
but that is throwing an error.
Looking at homebridge-hatch the first thing I think would need to happen is adding riot
and riotPlus
as device types in the iotProducts
url params.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.