gurumitts / pylutron-caseta

Apache License 2.0
153 stars 97 forks source link

Home Assistant OS - startup log errors possible library race #148

Closed Anto79-ops closed 11 months ago

Anto79-ops commented 1 year ago

Hi,

Thanks for the library. Using the Lutron Caseta integration on HAOS/Rpi4. Integration works well, never really had an issue with it. However, about 60% of the time on startup of HA, I get logs associated with Lutron. It does not seem to affect the functionality as everything works. Here's some logs on the last startup that may be of interest


monitor loop has exited 6:17:56 PM – (CRITICAL) /usr/local/lib/python3.11/site-packages/pylutron_caseta/smartbridge.py 

Logger: pylutron_caseta.smartbridge Source: /usr/local/lib/python3.11/site-packages/pylutron_caseta/smartbridge.py:488 First occurred: 6:17:56 PM (1 occurrences) Last logged: 6:17:56 PM monitor loop has exited Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/pylutron_caseta/smartbridge.py", line 512, in _monitor_once await self._leap.run() File "/usr/local/lib/python3.11/site-packages/pylutron_caseta/leap.py", line 78, in run received = await self._reader.readline() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/asyncio/streams.py", line 549, in readline line = await self.readuntil(sep) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/asyncio/streams.py", line 641, in readuntil await self._wait_for_data('readuntil') File "/usr/local/lib/python3.11/asyncio/streams.py", line 526, in _wait_for_data await self._waiter asyncio.exceptions.CancelledError During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/pylutron_caseta/smartbridge.py", line 484, in _monitor await self._monitor_once() File "/usr/local/lib/python3.11/site-packages/pylutron_caseta/smartbridge.py", line 536, in _monitor_once self._leap.close() File "/usr/local/lib/python3.11/site-packages/pylutron_caseta/leap.py", line 169, in close request.set_exception(BridgeDisconnectedError()) asyncio.exceptions.InvalidStateError: invalid state 

Logger: pylutron_caseta.leap Source: runner.py:186 First occurred: 6:18:43 PM (1 occurrences) Last logged: 6:18:43 PM Was not expecting message with tag ab0a4146-2e79-474f-b693-7ffabc840f71: {'CommuniqueType': 'SubscribeResponse', 'Header': {'MessageBodyType': 'MultipleOccupancyGroupStatus', 'StatusCode': '200 OK', 'Url': '/occupancygroup/status'}, 'Body': {'OccupancyGroupStatuses': [{'href': '/occupancygroup/1/status', 'OccupancyGroup': {'href': '/occupancygroup/1'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/2/status', 'OccupancyGroup': {'href': '/occupancygroup/2'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/3/status', 'OccupancyGroup': {'href': '/occupancygroup/3'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/4/status', 'OccupancyGroup': {'href': '/occupancygroup/4'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/5/status', 'OccupancyGroup': {'href': '/occupancygroup/5'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/6/status', 'OccupancyGroup': {'href': '/occupancygroup/6'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/7/status', 'OccupancyGroup': {'href': '/occupancygroup/7'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/8/status', 'OccupancyGroup': {'href': '/occupancygroup/8'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/9/status', 'OccupancyGroup': {'href': '/occupancygroup/9'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/10/status', 'OccupancyGroup': {'href': '/occupancygroup/10'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/11/status', 'OccupancyGroup': {'href': '/occupancygroup/11'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/12/status', 'OccupancyGroup': {'href': '/occupancygroup/12'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/13/status', 'OccupancyGroup': {'href': '/occupancygroup/13'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/14/status', 'OccupancyGroup': {'href': '/occupancygroup/14'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/15/status', 'OccupancyGroup': {'href': '/occupancygroup/15'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/16/status', 'OccupancyGroup': {'href': '/occupancygroup/16'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/17/status', 'OccupancyGroup': {'href': '/occupancygroup/17'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/18/status', 'OccupancyGroup': {'href': '/occupancygroup/18'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/19/status', 'OccupancyGroup': {'href': '/occupancygroup/19'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/20/status', 'OccupancyGroup': {'href': '/occupancygroup/20'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/21/status', 'OccupancyGroup': {'href': '/occupancygroup/21'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/22/status', 'OccupancyGroup': {'href': '/occupancygroup/22'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/23/status', 'OccupancyGroup': {'href': '/occupancygroup/23'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/24/status', 'OccupancyGroup': {'href': '/occupancygroup/24'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/25/status', 'OccupancyGroup': {'href': '/occupancygroup/25'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/26/status', 'OccupancyGroup': {'href': '/occupancygroup/26'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/27/status', 'OccupancyGroup': {'href': '/occupancygroup/27'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/28/status', 'OccupancyGroup': {'href': '/occupancygroup/28'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/29/status', 'OccupancyGroup': {'href': '/occupancygroup/29'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/30/status', 'OccupancyGroup': {'href': '/occupancygroup/30'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/31/status', 'OccupancyGroup': {'href': '/occupancygroup/31'}, 'OccupancyStatus': 'Unknown'}, {'href': '/occupancygroup/32/status', 'OccupancyGroup': {'href': '/occupancygroup/32'}, 'OccupancyStatus': 'Unknown'}]}} 
Anto79-ops commented 11 months ago

have not seen this issue since https://github.com/home-assistant/core/pull/101630.

thanksd