Comments (6)
👍 well not for hardcoding config but a way to manually specify the config file.
Basically change this (I've removed some comments to make it easier to read)
class Bridge(object):
def __init__(self, ip=None, username=None):
if os.access(os.getenv(USER_HOME), os.W_OK):
self.config_file_path = os.path.join(
os.getenv(USER_HOME), '.python_hue')
else:
self.config_file_path = os.path.join(os.getcwd(), '.python_hue')
becomes
class Bridge(object):
def __init__(self, ip=None, username=None, config_file_path=None):
if config_file_path and os.access(config_file_path, os.W_OK):
self.config_file_path = config_file_path
else:
if os.access(os.getenv(USER_HOME), os.W_OK):
self.config_file_path = os.path.join(
os.getenv(USER_HOME), '.python_hue')
else:
self.config_file_path = os.path.join(os.getcwd(), '.python_hue')
I'm sure it can be done better. but idea is add an optional config_file_path so it can be specified at runtime
from phue.
@studioimaginaire - any thoughts on this? Want to chime in?
from phue.
Will be back in town next week and will have a look !
from phue.
Thanks!
Jeremy Blum
Blum Idea Labs, LLC.
http://www.jeremyblum.com
Sent from my phone, please excuse the brevity.
On Jan 24, 2014 5:10 PM, "Nathanaël Lécaudé" [email protected]
wrote:
Will be back in town next week and will have a look !
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/21#issuecomment-33276543
.
from phue.
Hmmm,
You could also just pass the username to the bridge object :
b = Bridge('192.168.1.xx', 'username')
where username is the hex key.
Would that be a suitable workaround ?
from phue.
That seems like a perfectly reasonable approach to me. Do you think you may loop that into a future release?
from phue.
Related Issues (20)
- ConnectionResetError: [Errno 54] Connection reset by peer HOT 2
- Python Hue Config File Location HOT 4
- Phue --host error
- Syntax error on "is not" operator usage on Python 3.9 HOT 1
- Proposing a PR to fix a few small typos
- No route to host HOT 4
- new 40 second delay? HOT 1
- Wrong Color HOT 1
- get_ip_address method isnt working
- Log level for scoped logger set wrong
- release 1.2 HOT 4
- use unittest.mock instead of mock HOT 1
- Timing out HOT 1
- schedule gets accesoires
- Stop the entertainment stream
- Is the smart plug supported? HOT 1
- How do scenes work?
- TypeError: list indices must be integers or slices, not str HOT 4
- set_light vs set_group : discrepancy
- occasional socket.error: [Errno 111] Connection refused requiring physical reboot?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phue.