Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert to old working #996

Merged
merged 33 commits into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
50b3468
Update discover.py
hendriksen-mark Dec 17, 2023
0fb0da6
Update configHandler.py
hendriksen-mark Dec 17, 2023
59d6416
end wake up
hendriksen-mark Dec 25, 2023
0744d29
Merge branch 'master' of https://github.com/hendriksen-mark/diyHue
hendriksen-mark Dec 25, 2023
054975b
Update v2restapi.py
hendriksen-mark Dec 26, 2023
1cee7ec
Merge branch 'master' of https://github.com/hendriksen-mark/diyHue
hendriksen-mark Dec 26, 2023
8622dd9
Merge branch 'master' of https://github.com/hendriksen-mark/diyHue
hendriksen-mark Dec 28, 2023
a4447a2
wrong response
hendriksen-mark Dec 28, 2023
cf35307
add all buttons to response
hendriksen-mark Dec 28, 2023
a48cbd8
Merge branch 'master' of https://github.com/hendriksen-mark/diyHue
hendriksen-mark Dec 31, 2023
5e72c8d
Update discover.py
hendriksen-mark Jan 7, 2024
2a55e82
Merge branch 'diyhue:master' into master
hendriksen-mark Jan 7, 2024
253525d
Merge branch 'diyhue:master' into master
hendriksen-mark Jan 20, 2024
dcdbcf7
Merge branch 'master' of https://github.com/hendriksen-mark/diyHue
hendriksen-mark Jan 22, 2024
32d64b5
Merge branch 'master' of https://github.com/hendriksen-mark/diyHue
hendriksen-mark Feb 5, 2024
68d4ce0
update wake-up
hendriksen-mark Feb 9, 2024
32189d3
Merge branch 'master' of https://github.com/hendriksen-mark/diyHue
hendriksen-mark Feb 9, 2024
e15cc9d
Merge branch 'master' of https://github.com/hendriksen-mark/diyHue
hendriksen-mark Feb 14, 2024
4ec90bc
fix add light in hue app
hendriksen-mark Feb 14, 2024
50e15b2
Update requirements.txt
hendriksen-mark Feb 17, 2024
e027ffa
Merge branch 'diyhue:master' into master
hendriksen-mark Feb 17, 2024
22b5304
Update requirements.txt
hendriksen-mark Feb 17, 2024
49ca63f
Update Dockerfile
hendriksen-mark Feb 17, 2024
6671df9
Update Dockerfile
hendriksen-mark Feb 17, 2024
b73871b
Update Dockerfile
hendriksen-mark Feb 17, 2024
380e397
Update requirements.txt
hendriksen-mark Feb 17, 2024
4aaf325
Update requirements.txt
hendriksen-mark Feb 17, 2024
f5587fc
Update Dockerfile
hendriksen-mark Feb 17, 2024
0fdd6f7
Update requirements.txt
hendriksen-mark Feb 17, 2024
2c4860d
Update Dockerfile
hendriksen-mark Feb 17, 2024
2eabbbd
revert to old working
hendriksen-mark Feb 17, 2024
a0127b5
Merge branch 'master' of https://github.com/hendriksen-mark/diyHue
hendriksen-mark Feb 17, 2024
c5cf604
Update Dockerfile
hendriksen-mark Feb 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 6 additions & 31 deletions BridgeEmulator/configManager/configInit.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import logManager
import uuid
import netifaces
from random import randrange
logging = logManager.logger.get_logger(__name__)

Expand All @@ -9,37 +8,13 @@ def _generate_unique_id():
return "00:17:88:01:00:%02x:%02x:%02x-0b" % (rand_bytes[0],rand_bytes[1],rand_bytes[2])

def write_args(args, yaml_config):
host_ip = args['HOST_IP']

devices = []
for interface in netifaces.interfaces():
for family, addresses in netifaces.ifaddresses(interface).items():
if family not in (netifaces.AF_INET, netifaces.AF_INET6):
continue
for address in addresses:
if address['addr'] == host_ip:
devices.append((family, interface))
logging.debug('Found network devices ' + str(devices))

gateway_ips = []
for family, gateways in netifaces.gateways().items():
for device in devices:
if family != device[0]:
continue
for gateway in gateways:
if gateway[1] == device[1]:
gateway_ips.append(gateway[0])
logging.debug('Found gateways ' + str(gateway_ips))

if not gateway_ips:
ip_pieces = host_ip.split('.')
gateway_ips.append(ip_pieces[0] + '.' + ip_pieces[1] + '.' + ip_pieces[2] + '.1')
logging.info('Found no gateways and use fallback ' + str(gateway_ips))

yaml_config['config']['ipaddress'] = host_ip
yaml_config['config']['gateway'] = gateway_ips[0]
yaml_config['config']['mac'] = args['FULLMAC']
yaml_config['config']['bridgeid'] = (args['MAC'][:6] + 'FFFE' + args['MAC'][-6:]).upper()
host_ip = args["HOST_IP"]
ip_pieces = 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"]["mac"] = args["FULLMAC"]
yaml_config["config"]["bridgeid"] = (args["MAC"][:6] + 'FFFE' + args["MAC"][-6:]).upper()
return yaml_config

def generate_security_key(yaml_config):
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ yeelight
python-kasa==0.4.1
bleak==0.14.3
rgbxy==0.5
netifaces==0.11.0