mjg59 / python-broadlink

Python module for controlling Broadlink RM2/3 (Pro) remote controls, A1 sensor platforms and SP2/3 smartplugs
MIT License
1.39k stars 480 forks source link

modify support 0x4EF7 mp1, which MP1 can return the energy state #615

Closed vaughan-zeng closed 3 years ago

vaughan-zeng commented 3 years ago

0x4EF7: (mp1m, "MP1-1K4S", "Broadlink (OEM)") This type MP1 can return the energy state.

hamwong commented 3 years ago

Hi, Thanks for this update, I have been waiting it for long times, but I got error when I try to discovery

[17:35:42] openhabian@OpenhabianPi3B:~/MQTT/python-broadlink/cli$ ./broadlink_discovery
Traceback (most recent call last):
  File "./broadlink_discovery", line 4, in <module>
    import broadlink
  File "/usr/local/lib/python3.7/dist-packages/broadlink-0.17.0-py3.7.egg/broadlink/__init__.py", line 98, in <module>
    0x4EF7: (mp1m, "MP1-1K4S", "Broadlink (OEM)"),
NameError: name 'mp1m' is not defined

you missed init.py line 14

from .switch import bg1, mp1, mp1m, sp1, sp2, sp2s, sp3, sp3s, sp4, sp4b
vaughan-zeng commented 3 years ago

Hi, Thanks for this update, I have been waiting it for long times, but I got error when I try to discovery

[17:35:42] openhabian@OpenhabianPi3B:~/MQTT/python-broadlink/cli$ ./broadlink_discovery
Traceback (most recent call last):
  File "./broadlink_discovery", line 4, in <module>
    import broadlink
  File "/usr/local/lib/python3.7/dist-packages/broadlink-0.17.0-py3.7.egg/broadlink/__init__.py", line 98, in <module>
    0x4EF7: (mp1m, "MP1-1K4S", "Broadlink (OEM)"),
NameError: name 'mp1m' is not defined

you missed init.py line 14

from .switch import bg1, mp1, mp1m, sp1, sp2, sp2s, sp3, sp3s, sp4, sp4b

you're right.

felipediel commented 3 years ago

Awesome, thank you! Could you please push this PR to the dev branch to avoid conflicts?

felipediel commented 3 years ago

If you use the same method we are using for SP3S sensors, does it work?

felipediel commented 3 years ago

Added, thank you!