sanghviharshit / ha-mila

🏡 💨 Home Assistant custom component for Mila Air Purifier (Unofficial)
http://rwrd.io/mtcrbhl
MIT License
44 stars 12 forks source link

fast loop lock #42

Open disruptivepatternmaterial opened 3 weeks ago

disruptivepatternmaterial commented 3 weeks ago

Sometime last night this code went into a crazy loop that locked up ha for me and I had to remove it. I am not sure what the issue it as there is nothing in the log other than the normal errors that have been occurring since the modes changed and no one fixed.


Traceback (most recent call last):
  File "/config/custom_components/mila/entities/appliance/smart_mode_switch.py", line 37, in is_on
  File "/config/custom_components/mila/devices/device.py", line 85, in get_value
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/__init__.py", line 54, in __getitem__
    super(benedict, self).__getitem__(key))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/keypath/keypath_dict.py", line 36, in __getitem__
    return super(KeypathDict, self).__getitem__(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/keylist/keylist_dict.py", line 43, in __getitem__
    return super(KeylistDict, self).__getitem__(key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/base/base_dict.py", line 43, in __getitem__
    return self._dict[key]
           ~~~~~~~~~~^^^^^
KeyError: 'smartModes'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/mila/entities/appliance/smart_mode_switch.py", line 37, in is_on
  File "/config/custom_components/mila/devices/device.py", line 85, in get_value
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/__init__.py", line 54, in __getitem__
    super(benedict, self).__getitem__(key))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/keypath/keypath_dict.py", line 36, in __getitem__
    return super(KeypathDict, self).__getitem__(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/keylist/keylist_dict.py", line 43, in __getitem__
    return super(KeylistDict, self).__getitem__(key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/base/base_dict.py", line 43, in __getitem__
    return self._dict[key]
           ~~~~~~~~~~^^^^^
KeyError: 'smartModes'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/mila/entities/appliance/smart_mode_switch.py", line 37, in is_on
  File "/config/custom_components/mila/devices/device.py", line 85, in get_value
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/__init__.py", line 54, in __getitem__
    super(benedict, self).__getitem__(key))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/keypath/keypath_dict.py", line 36, in __getitem__
    return super(KeypathDict, self).__getitem__(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/keylist/keylist_dict.py", line 43, in __getitem__
    return super(KeylistDict, self).__getitem__(key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/base/base_dict.py", line 43, in __getitem__
    return self._dict[key]
           ~~~~~~~~~~^^^^^
KeyError: 'smartModes'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/mila/entities/appliance/smart_mode_switch.py", line 37, in is_on
  File "/config/custom_components/mila/devices/device.py", line 85, in get_value
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/__init__.py", line 54, in __getitem__
    super(benedict, self).__getitem__(key))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/keypath/keypath_dict.py", line 36, in __getitem__
    return super(KeypathDict, self).__getitem__(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/keylist/keylist_dict.py", line 43, in __getitem__
    return super(KeylistDict, self).__getitem__(key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/base/base_dict.py", line 43, in __getitem__
    return self._dict[key]
           ~~~~~~~~~~^^^^^
KeyError: 'smartModes'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/mila/entities/appliance/smart_mode_switch.py", line 37, in is_on
  File "/config/custom_components/mila/devices/device.py", line 85, in get_value
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/__init__.py", line 54, in __getitem__
    super(benedict, self).__getitem__(key))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/keypath/keypath_dict.py", line 36, in __getitem__
    return super(KeypathDict, self).__getitem__(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/keylist/keylist_dict.py", line 43, in __getitem__
    return super(KeylistDict, self).__getitem__(key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/base/base_dict.py", line 43, in __getitem__
    return self._dict[key]
           ~~~~~~~~~~^^^^^
KeyError: 'smartModes'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/mila/entities/appliance/smart_mode_switch.py", line 37, in is_on
  File "/config/custom_components/mila/devices/device.py", line 85, in get_value
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/__init__.py", line 54, in __getitem__
    super(benedict, self).__getitem__(key))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/keypath/keypath_dict.py", line 36, in __getitem__
    return super(KeypathDict, self).__getitem__(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/keylist/keylist_dict.py", line 43, in __getitem__
    return super(KeylistDict, self).__getitem__(key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/base/base_dict.py", line 43, in __getitem__
    return self._dict[key]
           ~~~~~~~~~~^^^^^
KeyError: 'smartModes'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/mila/entities/appliance/smart_mode_switch.py", line 37, in is_on
  File "/config/custom_components/mila/devices/device.py", line 85, in get_value
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/__init__.py", line 54, in __getitem__
    super(benedict, self).__getitem__(key))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/keypath/keypath_dict.py", line 36, in __getitem__
    return super(KeypathDict, self).__getitem__(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/keylist/keylist_dict.py", line 43, in __getitem__
    return super(KeylistDict, self).__getitem__(key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/base/base_dict.py", line 43, in __getitem__
    return self._dict[key]
           ~~~~~~~~~~^^^^^
KeyError: 'smartModes'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/mila/entities/appliance/smart_mode_switch.py", line 37, in is_on
  File "/config/custom_components/mila/devices/device.py", line 85, in get_value
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/__init__.py", line 54, in __getitem__
    super(benedict, self).__getitem__(key))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/keypath/keypath_dict.py", line 36, in __getitem__
    return super(KeypathDict, self).__getitem__(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/keylist/keylist_dict.py", line 43, in __getitem__
    return super(KeylistDict, self).__getitem__(key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/base/base_dict.py", line 43, in __getitem__
    return self._dict[key]
           ~~~~~~~~~~^^^^^
KeyError: 'smartModes'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/mila/entities/appliance/smart_mode_switch.py", line 37, in is_on
  File "/config/custom_components/mila/devices/device.py", line 85, in get_value
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/__init__.py", line 54, in __getitem__
    super(benedict, self).__getitem__(key))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/keypath/keypath_dict.py", line 36, in __getitem__
    return super(KeypathDict, self).__getitem__(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/keylist/keylist_dict.py", line 43, in __getitem__
    return super(KeylistDict, self).__getitem__(key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/base/base_dict.py", line 43, in __getitem__
    return self._dict[key]
           ~~~~~~~~~~^^^^^
KeyError: 'smartModes'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/mila/entities/appliance/smart_mode_switch.py", line 37, in is_on
  File "/config/custom_components/mila/devices/device.py", line 85, in get_value
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/__init__.py", line 54, in __getitem__
    super(benedict, self).__getitem__(key))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/keypath/keypath_dict.py", line 36, in __getitem__
    return super(KeypathDict, self).__getitem__(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/keylist/keylist_dict.py", line 43, in __getitem__
    return super(KeylistDict, self).__getitem__(key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/base/base_dict.py", line 43, in __getitem__
    return self._dict[key]
           ~~~~~~~~~~^^^^^
KeyError: 'smartModes'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/mila/entities/appliance/smart_mode_switch.py", line 37, in is_on
  File "/config/custom_components/mila/devices/device.py", line 85, in get_value
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/__init__.py", line 54, in __getitem__
    super(benedict, self).__getitem__(key))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/keypath/keypath_dict.py", line 36, in __getitem__
    return super(KeypathDict, self).__getitem__(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/keylist/keylist_dict.py", line 43, in __getitem__
    return super(KeylistDict, self).__getitem__(key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/base/base_dict.py", line 43, in __getitem__
    return self._dict[key]
           ~~~~~~~~~~^^^^^
KeyError: 'smartModes'
disruptivepatternmaterial commented 3 weeks ago

https://github.com/disruptivepatternmaterial/ha-mila

removed smart mode completely - never made sense to me anyhow I just want the sensors here....

will work on some of the other issues and do a pr or use my fork as this repo seems a little under loved

simbaja commented 1 week ago

Just incorporated your changes to hopefully fix this issue - let me know if it's still problematic