sensor.ssh
sensor.ssh copied to clipboard
Stopped working on 2023.6.0b
This usefull component stopped working on HA 2023.6.0b2 Log output:
Source: custom_components/ssh/sensor.py:44
Integration: ssh ([documentation](https://github.com/custom-components/sensor.ssh))
First occurred: 12:13:20 (4 occurrences)
Last logged: 12:31:51
Unexpected exception importing platform custom_components.ssh.sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 833, in get_platform
cache[full_name] = self._import_platform(platform_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 850, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/config/custom_components/ssh/sensor.py", line 44, in <module>
@asyncio.coroutine
^^^^^^^^^^^^^^^^^
AttributeError: module 'asyncio' has no attribute 'coroutine'```
Guessing this has been abandoned, I'll fix and fork, but it may be better to find something that someone else is supporting going forward
Quick change in sensors.py
from
@asyncio.coroutine
def async_setup_platform(
to:-
async def async_setup_platform(
@Stevehans That fixed it, thank you.
@Stevehans easy fix! thank you so much
@Stevehans thank you very much! Unfortunately, another error emerged:
Detected blocking call to sleep with args (0.0001,) inside the event loop by custom integration 'ssh' at custom_components/ssh/sensor.py, line 135: self._ssh.login(self._host, self._username, (offender: /usr/local/lib/python3.12/site-packages/pexpect/expect.py, line 113: time.sleep(self.spawn.delayafterread)), please report it to the author of the 'ssh' custom integration For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#sleep Traceback (most recent call last): File "
Do you have any idea how to approach this? From log, I know it's not the only custom component having such a problem, iClod3 and better_trhermostatat also face the same problem.