Skip to content

Commit

Permalink
Reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Sep 2, 2020
1 parent 429f3db commit e95d825
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions custom_components/xiaomi_gateway3/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,6 @@
from logging import FileHandler, Formatter
from typing import Optional

GLOBAL_PROP = {
'8.0.2001': 'battery',
'8.0.2002': 'reset_cnt',
'8.0.2003': 'send_all_cnt',
'8.0.2004': 'send_fail_cnt',
'8.0.2005': 'send_retry_cnt',
'8.0.2006': 'chip_temperature',
'8.0.2007': 'lqi',
'8.0.2008': 'voltage',
'8.0.2009': 'pv_state',
'8.0.2010': 'cur_state',
'8.0.2011': 'pre_state',
'8.0.2012': 'power_tx',
'8.0.2013': 'CCA',
'8.0.2014': 'protect',
'8.0.2015': 'power',
'8.0.2022': 'fw_ver',
'8.0.2023': 'hw_ver',
'8.0.2030': 'poweroff_memory',
'8.0.2031': 'charge_protect',
'8.0.2032': 'en_night_tip_light',
'8.0.2034': 'load_s0', # ctrl_dualchn
'8.0.2035': 'load_s1', # ctrl_dualchn
'8.0.2036': 'parent',
'8.0.2041': 'model',
'8.0.2042': 'max_power',
'8.0.2044': 'plug_detection',
'8.0.2101': 'nl_invert', # ctrl_86plug
'8.0.9001': 'battery_end_of_life'
}

# https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/devices.js#L390
# https://slsys.io/action/devicelists.html
# Zigbee Model: [Manufacturer, Device Name, Device Model]
Expand Down Expand Up @@ -230,6 +199,37 @@
]
}]

GLOBAL_PROP = {
'8.0.2001': 'battery',
'8.0.2002': 'reset_cnt',
'8.0.2003': 'send_all_cnt',
'8.0.2004': 'send_fail_cnt',
'8.0.2005': 'send_retry_cnt',
'8.0.2006': 'chip_temperature',
'8.0.2007': 'lqi',
'8.0.2008': 'voltage',
'8.0.2009': 'pv_state',
'8.0.2010': 'cur_state',
'8.0.2011': 'pre_state',
'8.0.2012': 'power_tx',
'8.0.2013': 'CCA',
'8.0.2014': 'protect',
'8.0.2015': 'power',
'8.0.2022': 'fw_ver',
'8.0.2023': 'hw_ver',
'8.0.2030': 'poweroff_memory',
'8.0.2031': 'charge_protect',
'8.0.2032': 'en_night_tip_light',
'8.0.2034': 'load_s0', # ctrl_dualchn
'8.0.2035': 'load_s1', # ctrl_dualchn
'8.0.2036': 'parent',
'8.0.2041': 'model',
'8.0.2042': 'max_power',
'8.0.2044': 'plug_detection',
'8.0.2101': 'nl_invert', # ctrl_86plug
'8.0.9001': 'battery_end_of_life'
}


def get_device(zigbee_model: str) -> Optional[dict]:
# the model has an extra tail when added
Expand Down

0 comments on commit e95d825

Please sign in to comment.