mirror of
https://github.com/danieldemus/openhab-addons
synced 2026-07-31 05:24:24 +02:00
[mqtt.homeassistant] Fix python packages path on Windows (#19249)
So explicitly add the *nix-style path to the syspath, so that even on Windows the installed packages can be found. Signed-off-by: Cody Cutrer <cody@cutrer.us>
This commit is contained in:
+8
@@ -60,6 +60,14 @@ public class HomeAssistantPythonBridge {
|
||||
|
||||
context.eval(PYTHON,
|
||||
"""
|
||||
# we need to set up the path just like it would have been set up on Linux, even if we're
|
||||
# on Windows
|
||||
import os
|
||||
import sys
|
||||
|
||||
if os.sep != '/':
|
||||
sys.path.append(os.path.join(sys.prefix, "lib", "python%d.%d" % sys.version_info[:2], "site-packages"))
|
||||
|
||||
from homeassistant.helpers.template import Template
|
||||
from homeassistant.components.mqtt.models import MqttCommandTemplate, MqttValueTemplate
|
||||
from homeassistant.components.mqtt.discovery import process_discovery_config
|
||||
|
||||
Reference in New Issue
Block a user