claudegel / sinope-130

Neviweb130 custom component for Home Assistant to manage devices connected via a GT130 and wifi devices from Sinopé
GNU General Public License v3.0
67 stars 15 forks source link

Following 2024.7.3 HA update, MC3100ZB controller becomes unavailable. #253

Closed andguay closed 1 month ago

andguay commented 1 month ago

Tried to rollback to 2024.7.2 but somehow the error is still there.

Everything works fine except the MC3100ZB controller.

If I try to re-add it is grayed-out image

Error Log entry : Logger: homeassistant.components.switch Source: helpers/entity_platform.py:727 integration: Switch (documentation, issues) First occurred: 9:37:11 PM (1 occurrences) Last logged: 9:37:11 PM

neviweb130: Error on device update! Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 727, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1298, in async_device_update await hass.async_add_executor_job(self.update) File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/neviweb130/switch.py", line 1472, in update self._drstatus_optout = device_data[ATTR_DRSTATUS][ATTR_OPTOUT]


KeyError: 'optOut'
claudegel commented 1 month ago

Ha yes Sinopé did change some attribute for the MC3100ZB. ATTR_OPTOUT is no ponger used for that device. I'll make a patch and let you know when it is ready

claudegel commented 1 month ago

Try this branch and let me know https://github.com/claudegel/sinope-130/tree/mc3100zb/custom_components/neviweb130 Just pick the switch.py file and paste over the one you have in HA. Restart HA and it should work.

andguay commented 1 month ago

Renamed switch.py to switch.old and uploaded new switch.py.

Sorry to report, new loading errors.

Home Assistant Core 2024-07-21 08:44:49.870 ERROR (ImportExecutor_0) [homeassistant.loader] Unexpected exception importing platform custom_components.neviweb130.switch 2024-07-21 08:44:49.941 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to import_module with args ('custom_components.neviweb130.switch',) in /usr/src/homeassistant/homeassistant/loader.py, line 1296: return importlib.import_module(f"{self.pkg_path}.{platform_name}") inside the event loop; This is causing stability issues. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue 2024-07-21 08:44:49.958 ERROR (MainThread) [homeassistant.loader] Unexpected exception importing platform custom_components.neviweb130.switch 2024-07-21 08:44:49.961 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform 'neviweb130.switch': Platform not found (Exception importing custom_components.neviweb130.switch).

Logger: homeassistant.setup Source: setup.py:485 First occurred: 8:44:49 AM (1 occurrences) Last logged: 8:44:49 AM

Unable to prepare setup for platform 'neviweb130.switch': Platform not found (Exception importing custom_components.neviweb130.switch).

Logger: homeassistant.loader Source: loader.py:1264 First occurred: 8:44:49 AM (2 occurrences) Last logged: 8:44:49 AM

Unexpected exception importing platform custom_components.neviweb130.switch Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/loader.py", line 1264, in _load_platform cache[full_name] = self._import_platform(platform_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 1296, in _import_platform return importlib.import_module(f"{self.pkg_path}.{platform_name}") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/importlib/init.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1387, in _gcd_import File "", line 1360, in _find_and_load File "", line 1331, in _find_and_load_unlocked File "", line 935, in _load_unlocked File "", line 991, in exec_module File "", line 1129, in get_code File "", line 1059, in source_to_code File "", line 488, in _call_with_frames_removed File "/config/custom_components/neviweb130/switch.py", line 111

sinope-130/custom_components/neviweb130/switch.py at mc3100zb · claudegel/sinope-130
                                                                     ^

SyntaxError: invalid character '·' (U+00B7)

claudegel commented 1 month ago

switch.py on that branch is the same as what I have on my HA and it load no problem. Maybe there is an error done when you copy the new switch.py. Can you open it and show me line 111, it should be ATTR_TEMP_ALARM,

andguay commented 1 month ago

Man... I feel so stupid. I copied the wrong file first time. Sorry... Everything works now.

Merci Claude ! :-)

claudegel commented 1 month ago

OK I'll push a release today.