yo-han / Home-Assistant-Carelink

Unofficial Home Assistant Carelink Component
MIT License
24 stars 12 forks source link

fix: catch missing dateTime KeyError #32

Closed yo-han closed 1 year ago

yo-han commented 1 year ago

Catch and log missing keys and indicies in the get_last_marker function.

fixes #31

redakker commented 1 year ago

@yo-han , Thank you for the quick fix, but comes another:

Logger: custom_components.carelink Source: custom_components/carelink/init.py:383 Integration: carelink First occurred: 08:23:14 (3 occurrences) Last logged: 08:23:40

Unexpected error fetching carelink data: 'medicalDeviceInformation' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _async_refresh self.data = await self._async_update_data() File "/config/custom_components/carelink/init.py", line 383, in _async_update_data data[SENSOR_KEY_MEDICAL_DEVICE_MANUFACTURER] = recent_data[ KeyError: 'medicalDeviceInformation'