Skip to content

Commit

Permalink
Add new device type mappings, add note about 'used_for_public' (#713)
Browse files Browse the repository at this point in the history
* add 'used_for_public' getter and setter

Not entirely sure what this command does, but I think it has to do with enabeling/disabeling developer mode.
In any case, I came accross this command while sniffing gateway trafic

* move used_for_public to comments

* remove space

* add 2 devices and the zigbee_ids as comments

* add values to used_for_public

* add zigbee_id

* fix black formatting
  • Loading branch information
starkillerOG authored Jun 4, 2020
1 parent 1c9c58d commit 96c9add
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions miio/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,30 @@ class DeviceType(IntEnum):
"""DeviceType matching using the values provided by Xiaomi."""

Unknown = -1
Gateway = 0
Gateway = 0 # lumi.0
Switch = 1
Motion = 2
Magnet = 3
SwitchTwoChannels = 7
Cube = 8
SwitchOneChannel = 9
Cube = 8 # lumi.sensor_cube.v1
SwitchOneChannel = 9 # lumi.ctrl_neutral1.v1
SensorHT = 10
Plug = 11
RemoteSwitchSingleV1 = 14 # lumi.sensor_86sw1.v1
SensorSmoke = 15
AqaraHT = 19
AqaraHT = 19 # lumi.weather.v1
SwitchLiveOneChannel = 20
SwitchLiveTwoChannels = 21
AqaraSwitch = 51
AqaraMotion = 52
AqaraMagnet = 53
AqaraMagnet = 53 # lumi.sensor_magnet.aq2
AqaraRelayTwoChannels = 54
AqaraSquareButton = 62
AqaraSquareButton = 62 # lumi.sensor_switch.aq3
AqaraSwitchOneChannel = 63
AqaraSwitchTwoChannels = 64
RemoteSwitchSingle = 134
RemoteSwitchDouble = 135
AqaraWallOutlet = 65 # lumi.ctrl_86plug.aq1
RemoteSwitchSingle = 134 # lumi.remote.b186acn01
RemoteSwitchDouble = 135 # lumi.remote.b286acn01


@attr.s(auto_attribs=True)
Expand All @@ -85,6 +87,9 @@ class Gateway(Device):
* remove_all_bind
* list_bind [0]
* self.get_prop("used_for_public") # Return the 'used_for_public' status, return value: [0] or [1], probably this has to do with developer mode.
* self.set_prop("used_for_public", state) # Set the 'used_for_public' state, value: 0 or 1, probably this has to do with developer mode.
* welcome
* set_curtain_level
Expand Down

0 comments on commit 96c9add

Please sign in to comment.