hass-ttlock icon indicating copy to clipboard operation
hass-ttlock copied to clipboard

Attribute Error: NoneType

Open amm5172 opened this issue 1 year ago • 6 comments

Receiving the following error on all of my locks (approximately 160 locks). Integration is set up and I can see that it is successfully collecting data but I have no devices listed in the integration. I have the following error multiple times in my log. Different users, different actions, different locks. Always the same error. AttributeError: 'NoneType' object has no attribute 'battery_level'

Logger: homeassistant.util.logging
Source: util/logging.py:168
First occurred: 3:07:44 PM (7 occurrences)
Last logged: 3:09:35 PM

Exception in _process_webhook_data when dispatching 'ttlock.data_received': (WebhookEvent(id=1847880, mac='C9:4B:4C:F1:B5:E1', battery_level=100, server_ts=datetime.datetime(2023, 7, 3, 15, 7, 44, 197000, tzinfo=zoneinfo.ZoneInfo(key='America/Chicago')), lock_ts=datetime.datetime(2023, 7, 3, 15, 7, 30, tzinfo=zoneinfo.ZoneInfo(key='America/Chicago')), event=Event(EventDescription(action=<Action.unlock: 3>, description='unlock by IC card')), user='hm', success=True),) Traceback (most recent call last): File "/config/custom_components/ttlock/coordinator.py", line 164, in _process_webhook_data new_data.battery_level = event.battery_level ^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'battery_level'

config_entry-ttlock-ee6731597785b54275112671a8614839.json (3).txt

amm5172 avatar Jul 03 '23 20:07 amm5172