Python Forum
Looking For Help On Controlling Philips Hue From PyCharm
Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Looking For Help On Controlling Philips Hue From PyCharm
#4
Follow @buran advice to first get Python setup before PyCharm,i guess you use Windows?
There are many Python modules made for this,eg the first one that show up in Google search.
phue: A Python library for Philips Hue.

To use it pretty straight forward.
If setup of Python is okay then the important pip work(Used to install all library/modules to Python).
Example:
# Test that pip work
C:\
λ pip -V
pip 18.1 from c:\python37\lib\site-packages\pip (python 3.7)

# Install phue
C:\
λ pip install phue
Collecting phue
  Downloading https://files.pythonhosted.org/packages/34/d2/35bfef007857ef2949b7271a263ef0c37cd9714f5b61f7d5ac02f20d7174/phue-1.0.tar.gz
Installing collected packages: phue
  Running setup.py install for phue ... done
Successfully installed phue-1.0
At this point is installed and look at it.
C:\
λ ptpython
>>> from phue import Bridge  

>>> Bridge
<class 'phue.Bridge'>

>>> Bridge.connect
<function Bridge.connect at 0x04C3A4F8>

>>> help(Bridge.connect)
Help on function connect in module phue:

connect(self)
    Connect to the Hue bridge

>>> help(Bridge)
Help on class Bridge in module phue:

class Bridge(builtins.object)
 |  Bridge(ip=None, username=None, config_file_path=None)
 |
 |  Interface to the Hue ZigBee bridge
 |
 |  You can obtain Light objects by calling the get_light_objects method:
 |
 |      >>> b = Bridge(ip='192.168.1.100')
 |      >>> b.get_light_objects()
 |      [<phue.Light at 0x10473d750>,
 |       <phue.Light at 0x1046ce110>]
 |
 |  Or more succinctly just by accessing this Bridge object as a list or dict:
 |
 |      >>> b[1]
 |      <phue.Light at 0x10473d750>
 |      >>> b['Kitchen']
 |      <phue.Light at 0x10473d750>
 |
 |  Methods defined here:
 |
 |  __getitem__(self, key)
 |      Lights are accessibly by indexing the bridge either with
-- More  --
So you see that setup work i don't have Philips Hue,so i can not test out connecting to IP out eg:
>>> b = Bridge('ip_of_your_bridge')
>>> b.get_light_objects()
Reply


Messages In This Thread
RE: Looking For Help On Controlling Philips Hue From PyCharm - by snippsat - Dec-11-2018, 10:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Controlling program with TCP commands lavacode 1 568 Jul-10-2023, 04:39 PM
Last Post: deanhystad
  Controlling text-to-speech pauses with pyttsx3 pmac1300 4 4,576 Mar-14-2022, 06:47 AM
Last Post: Coricoco_fr
  Controlling what get outputted to stdout when running external commands Daring_T 4 2,217 Jan-30-2022, 05:40 PM
Last Post: bowlofred
  Controlling Python Program From Django Front End sourabhjaiswal92 3 3,237 May-21-2018, 06:07 AM
Last Post: wavic
  controlling multiple server simultaneously. caligola 3 3,651 May-11-2018, 05:44 PM
Last Post: wavic
  Controlling trailing zeros with rounding? RedSkeleton007 1 24,567 Jan-25-2018, 07:23 AM
Last Post: j.crater

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020