mjg59 / python-broadlink

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

Rename MP1S state parameters #783

Closed felipediel closed 2 months ago

felipediel commented 2 months ago

Proposed change

Rename the newly added state parameters for MP1s to align with the state parameters used in the SP4 family.

For instance, in an SP4 payload, the parameters are as follows: {'pwr': 0, 'ntlight': 1, 'indicator': 1, 'usbpwr': 0, 'maxworktime': 0, 'usbmaxworktime': 0, 'ntlbrightness': 59, 'current': 0, 'volt': -1, 'power': 0, 'totalconsum': -1, 'overload': -1}.

So we are basically renaming "voltage" to "volt" and "power_consumption" to "totalconsum" in mp1s.get_state() to make it easier to integrate. The function name is also being changed from get_status to get_state.

Type of change

Additional information

Checklist