rytilahti / python-miio

Python library & console tool for controlling Xiaomi smart appliances
https://python-miio.readthedocs.io
GNU General Public License v3.0
3.65k stars 551 forks source link

Some element about Xiaomi Philips Bulb #43

Closed deennoo closed 7 years ago

deennoo commented 7 years ago

Thx to add support for this.

I test all fonction present for ceiling.

Some of them doesn't work, because this option aren't present on the app and on the device it self :

status return an error :

nico@debianpcnico:~$ miceil --ip 192.168.0.208 --token 324b4147dc6c1a9867f6e19ec9070ca0 status
Power: on
Brightness: 10
CCT: 1
Scene Number: 4
dv: 0
Traceback (most recent call last):
  File "/usr/local/bin/miceil", line 11, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.4/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.4/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.4/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.4/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args[1:], **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/mirobo/ceil_cli.py", line 104, in status
    click.echo("Smart Midnight Light: %s" % res.bl)
  File "/usr/local/lib/python3.4/dist-packages/mirobo/ceil.py", line 40, in bl
    return self.data["bl"]
KeyError: 'bl'

Hopping this can help !to provied a "mibulb" section

syssi commented 7 years ago

What's the name/type of your device?

deennoo commented 7 years ago

that the xiaomi philips led ball :

https://www.gearbest.com/smart-lighting/pp_644095.html

discover doesn't return anything

syssi commented 7 years ago

Okay. The "ceil" is the implementation of the Philips Ceiling Lamp. This device supports the features mentioned above. For the Philips Led Ball you are right. The command set should be reduced for this device. I will defuse the "bl" KeyError. I hit the same error implementing the home assistant component for the philips light.

deennoo commented 7 years ago

ok, for my cultur, what mean bl ?

syssi commented 7 years ago

bed light? ;-) I don't know. It's called Smart Midnight Light somewhere.