Skip to content

Commit

Permalink
Add identify request, non standard gateway, update version and api (#997
Browse files Browse the repository at this point in the history
)

* Update discover.py

* Update configHandler.py

* end wake up

* Update v2restapi.py

Add behavior instance to clip/v2/resource, to solve problem as in issue 873, now the app shows the automations

* wrong response

* add all buttons to response

* Update discover.py

Fix issue where lights with the same mac address but different modelid get the same ip address

* update wake-up

fix error "Exception while processing the schedule X | 'turn_lights_off_after'" if "turn_lights_off_after" is not specified

* fix add light in hue app

* Update requirements.txt

* Update requirements.txt

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update requirements.txt

* Update requirements.txt

* Update Dockerfile

* Update requirements.txt

* Update Dockerfile

* revert to old working

* Update Dockerfile

* Add identify request, non standard gateway, update version and api
  • Loading branch information
hendriksen-mark authored Feb 18, 2024
1 parent f968518 commit 2db6a0b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
8 changes: 4 additions & 4 deletions BridgeEmulator/configManager/configHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ def load_config(self):
config["zigbee_device_discovery_info"] = {"status": "ready"}

if int(config["swversion"]) < 1958077010:
config["swversion"] = "1958077010"
config["swversion"] = "1962154010"
if float(config["apiversion"][:3]) < 1.56:
config["apiversion"] = "1.56.0"
config["apiversion"] = "1.62.0"

self.yaml_config["config"] = config
else:
Expand All @@ -91,10 +91,10 @@ def load_config(self):
"alarm":{"enabled": False,"lasttriggered": 0},
"port":{"enabled": False,"ports": [80]},
"apiUsers":{},
"apiversion":"1.56.0",
"apiversion":"1.62.0",
"name":"DiyHue Bridge",
"netmask":"255.255.255.0",
"swversion":"19561788040",
"swversion":"1962154010",
"timezone":"Europe/London",
"linkbutton":{"lastlinkbuttonpushed": 1599398980},
"users":{"[email protected]":{"password":"pbkdf2:sha256:150000$bqqXSOkI$199acdaf81c18f6ff2f29296872356f4eb78827784ce4b3f3b6262589c788742"}},
Expand Down
7 changes: 5 additions & 2 deletions BridgeEmulator/configManager/configInit.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logManager
import uuid
from random import randrange
import subprocess
logging = logManager.logger.get_logger(__name__)

def _generate_unique_id():
Expand All @@ -9,10 +10,12 @@ def _generate_unique_id():

def write_args(args, yaml_config):

result = subprocess.run(["ip route | grep default | head -n 1 | cut -d ' ' -f 3"], shell=True, capture_output=True, text=True)

host_ip = args["HOST_IP"]
ip_pieces = host_ip.split(".")
ip_pieces = result.stdout.split(".")#host_ip.split(".")
yaml_config["config"]["ipaddress"] = host_ip
yaml_config["config"]["gateway"] = ip_pieces[0] + "." + ip_pieces[1] + "." + ip_pieces[2] + ".1"
yaml_config["config"]["gateway"] = ip_pieces[0] + "." + ip_pieces[1] + "." + ip_pieces[2] + "." + ip_pieces[3].replace("\n", "")#".1"
yaml_config["config"]["mac"] = args["FULLMAC"]
yaml_config["config"]["bridgeid"] = (args["MAC"][:6] + 'FFFE' + args["MAC"][-6:]).upper()
return yaml_config
Expand Down
3 changes: 3 additions & 0 deletions BridgeEmulator/flaskUI/v2restapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,9 @@ def put(self, resource, resourceid):
if putDict["action"]["action_type"] == "search":
bridgeConfig["config"]["zigbee_device_discovery_info"]["status"] = "active"
Thread(target=scanForLights).start()
elif resource == "device":
if putDict["identify"]["action"] == "identify":
object.setV1State({"alert": "select"})
else:
return {
"errors": [{
Expand Down

0 comments on commit 2db6a0b

Please sign in to comment.