-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update github workflow. Update wled behavior. Fix linkbutton in hue essentials. Add dummy light. Make mdns in line with philips.
- Loading branch information
1 parent
5515247
commit 14008aa
Showing
12 changed files
with
61 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
import weakref | ||
from copy import deepcopy | ||
from HueObjects import Light, Group, EntertainmentConfiguration, Scene, ApiUser, Rule, ResourceLink, Schedule, Sensor, BehaviorInstance, SmartScene | ||
from lights.protocols import wled | ||
try: | ||
from time import tzset | ||
except ImportError: | ||
|
@@ -28,6 +29,16 @@ def _write_yaml(path, contents): | |
with open(path, 'w', encoding="utf-8") as fp: | ||
yaml.dump(contents, fp , Dumper=NoAliasDumper, allow_unicode=True, sort_keys=False ) | ||
|
||
def reAddWled(old_light): | ||
detectedLights = [] | ||
wled.discover(detectedLights, old_light["protocol_cfg"]["ip"]) | ||
for light in detectedLights: | ||
if light["name"] == old_light["name"] and light["protocol_cfg"]["ip"] == old_light["protocol_cfg"]["ip"] and light["protocol_cfg"]["segmentId"] == old_light["protocol_cfg"]["segmentId"]: | ||
logging.info("Update Wled " + light["name"]) | ||
old_light["protocol_cfg"]["ledCount"] = light["protocol_cfg"]["ledCount"] | ||
old_light["protocol_cfg"]["segment_start"] = light["protocol_cfg"]["segment_start"] | ||
old_light["protocol_cfg"]["udp_port"] = light["protocol_cfg"]["udp_port"] | ||
return old_light | ||
|
||
class Config: | ||
yaml_config = None | ||
|
@@ -106,9 +117,11 @@ def load_config(self): | |
} | ||
|
||
if int(config["swversion"]) < 1958077010: | ||
config["swversion"] = "1965111030" | ||
config["swversion"] = "1967054020" | ||
if float(config["apiversion"][:3]) < 1.56: | ||
config["apiversion"] = "1.65.0" | ||
config["apiversion"] = "1.67.0" | ||
if "linkbutton" not in config or type(config["linkbutton"]) == bool or "lastlinkbuttonpushed" not in config["linkbutton"]: | ||
config["linkbutton"] = {"lastlinkbuttonpushed": 1599398980} | ||
|
||
self.yaml_config["config"] = config | ||
else: | ||
|
@@ -122,10 +135,10 @@ def load_config(self): | |
"alarm":{"enabled": False,"lasttriggered": 0}, | ||
"port":{"enabled": False,"ports": [80]}, | ||
"apiUsers":{}, | ||
"apiversion":"1.65.0", | ||
"apiversion":"1.67.0", | ||
"name":"DiyHue Bridge", | ||
"netmask":"255.255.255.0", | ||
"swversion":"1965111030", | ||
"swversion":"1967054020", | ||
"timezone": "Europe/London", | ||
"linkbutton":{"lastlinkbuttonpushed": 1599398980}, | ||
"users":{"[email protected]":{"password":"pbkdf2:sha256:150000$bqqXSOkI$199acdaf81c18f6ff2f29296872356f4eb78827784ce4b3f3b6262589c788742"}}, | ||
|
@@ -166,6 +179,8 @@ def load_config(self): | |
if os.path.exists(self.configDir + "/lights.yaml"): | ||
lights = _open_yaml(self.configDir + "/lights.yaml") | ||
for light, data in lights.items(): | ||
if data["protocol"] == "wled" and "segment_start" not in data["protocol_cfg"]: | ||
data = reAddWled(data) | ||
data["id_v1"] = light | ||
self.yaml_config["lights"][light] = Light.Light(data) | ||
#self.yaml_config["groups"]["0"].add_light(self.yaml_config["lights"][light]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from lights.protocols import wled, hyperion, yeelight, tasmota, shelly, mi_box, hue, deconz, domoticz, tradfri, native, native_single, native_multi, esphome, mqtt, wiz, milight, homeassistant_ws, tpkasa, hue_bl, elgato | ||
from lights.protocols import wled, hyperion, yeelight, tasmota, shelly, mi_box, hue, deconz, domoticz, tradfri, native, native_single, native_multi, esphome, mqtt, wiz, milight, homeassistant_ws, tpkasa, hue_bl, elgato, dummy | ||
|
||
protocols = [wled, hyperion, yeelight, tasmota, shelly, mi_box, hue, deconz, domoticz, tradfri, native, native_single, native_multi, esphome, mqtt, wiz, milight, homeassistant_ws, tpkasa, hue_bl, elgato] | ||
protocols = [wled, hyperion, yeelight, tasmota, shelly, mi_box, hue, deconz, domoticz, tradfri, native, native_single, native_multi, esphome, mqtt, wiz, milight, homeassistant_ws, tpkasa, hue_bl, elgato, dummy] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def set_light(light, data): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters