default bridge hostname can now be stored in a 'bridge' file.
This commit is contained in:
parent
91315b4b77
commit
88ae5dbd5a
6
hue.py
6
hue.py
|
@ -219,7 +219,7 @@ def main():
|
||||||
parser.add_argument('--user',
|
parser.add_argument('--user',
|
||||||
help='user (effectively password) at the bridge. If not given, read from file username')
|
help='user (effectively password) at the bridge. If not given, read from file username')
|
||||||
parser.add_argument('--bridge',
|
parser.add_argument('--bridge',
|
||||||
help='hostname/IP of the bridge. Default: philips-hue.local')
|
help='hostname/IP of the bridge. Default: philips-hue.local, or the contents of the file "bridge" in the current directory')
|
||||||
parser.add_argument('--getuser',
|
parser.add_argument('--getuser',
|
||||||
help='get username (security code) from bridge (after button on bridge is pressed)')
|
help='get username (security code) from bridge (after button on bridge is pressed)')
|
||||||
|
|
||||||
|
@ -252,7 +252,9 @@ def main():
|
||||||
#configuration
|
#configuration
|
||||||
if args.bridge is not None:
|
if args.bridge is not None:
|
||||||
bridgeAddr=args.bridge
|
bridgeAddr=args.bridge
|
||||||
|
else:
|
||||||
|
if os.path.exists('bridge'):
|
||||||
|
bridgeAddr=open('bridge','r').read().strip()
|
||||||
try:
|
try:
|
||||||
if args.getuser is not None:
|
if args.getuser is not None:
|
||||||
getuser(args.getuser)
|
getuser(args.getuser)
|
||||||
|
|
Loading…
Reference in New Issue