beveradb / sonoff-lan-mode-homeassistant

Home Assistant platform to control Sonoff switches running the latest Itead firmware, locally (LAN mode).
MIT License
74 stars 36 forks source link

No module named `websocket` #2

Closed tiagoboldt closed 5 years ago

tiagoboldt commented 5 years ago

Great job. I've got my S20 working in lan mode and can toggle it with your javascript script.

Now for the home assistant one, I've added the file as described, but I always get an error, given that my home assistant does not have websockets installed.

Jan 07 17:04:52 rpi hass[16784]: from websocket import create_connection Jan 07 17:04:52 rpi hass[16784]: ModuleNotFoundError: No module named 'websocket'

I've tried adding:

REQUIREMENTS = ['websockets==7.0.0']

but this is not installing the requirement automatically. It might also be an issue importing the requirement outside a function, according to the note section here: https://developers.home-assistant.io/docs/en/creating_component_deps_and_reqs.html#note