homeassistant-ssh icon indicating copy to clipboard operation
homeassistant-ssh copied to clipboard

Systemd switch not working as expected

Open dapuzz opened this issue 10 months ago • 1 comments

Hi Adrian, Copying your example systemctl -a | awk '/hyperion.service|pure-ftpd.service/ {print $1 "," $4}' create the switch just when the service is running. As soon as the switch is turned off, it became unavaiable I suppose because the systemctl -a does not return anything if the service is not active.

2024-04-14 00:32:27.306 DEBUG (MainThread) [custom_components.ssh] raspberrypi: systemctl -a | awk '/kodi.service|hyperion.service|drm-capture.service|pure-ftpd.service/ {print $1 "," $4}' => ['hyperion.service,running'], [], 0
2024-04-14 00:32:27.307 DEBUG (MainThread) [custom_components.ssh] raspberrypi: service_hyperion_service => True
2024-04-14 00:32:27.307 DEBUG (MainThread) [custom_components.ssh] Finished fetching raspberrypi service data in 0.037 seconds (success: True)

image

Do you have any suggestion? Thank you

dapuzz avatar Apr 13 '24 22:04 dapuzz