I’m running the Hassio image on a Raspberry pi.
I created a custom component that uses the asyncws module.
It is defined a service and sends data to an arduino (webserver)
When I manually install it from the terminal via ‘pip install asyncws’ it works fine however after a restart it is no longer working.
I already included it as requirement in my manifest.json but no joy.
I’ve been looking all over but could not find a solution for this issue.
Is there a way to install it permanently onto hassio?
import asyncio
import logging
import json
import asyncws
from .const import (
VERSION,
DOMAIN,
CMDS
)
_LOGGER = logging.getLogger(name)
version = VERSION
async def setup(hass, config):
“Initialize the service”
_LOGGER.info(“Set up of integration %s, version %s”, DOMAIN, VERSION)
async def handle_data(call):
myDict = {
"data_1": 120,
"data_2": 3,
"data_1": 0
}
websocket = await asyncws.connect('ws://192.168.1.101')
await websocket.send(json.dumps(myDict))
while True:
message = await websocket.recv()
if message is None:
break
print(message)
break
hass.services.register(DOMAIN, "rbus", handle_data)
return True
Thx