Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Powerstrip support improved #239

Merged
merged 6 commits into from
Feb 27, 2018

Conversation

syssi
Copy link
Collaborator

@syssi syssi commented Feb 26, 2018

New properties and commands added: wifi_led, power_price.

@rytilahti Could you provide a response example for

mirobo raw_command get_prop "['power', 'temperature', 'current', 'mode', 'power_consume_rate', 'wifi_led', 'power_price']"

Thanks!

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.06%) to 65.793% when pulling 56d599c on syssi:feature/powerstrip-support-improved into b729455 on rytilahti:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.06%) to 65.793% when pulling 56d599c on syssi:feature/powerstrip-support-improved into b729455 on rytilahti:master.

@coveralls
Copy link

coveralls commented Feb 26, 2018

Coverage Status

Coverage increased (+0.6%) to 66.426% when pulling 78fb995 on syssi:feature/powerstrip-support-improved into b729455 on rytilahti:master.

@rytilahti
Copy link
Owner

rytilahti commented Feb 26, 2018

Sending cmd get_prop with params ['power', 'temperature', 'current', 'mode', 'power_consume_rate', 'wifi_led', 'power_price']
['on', 48.7, 0.05, None, 4.09, 'on', 49]

Thanks for extending the support :-)

The mode is missing on this device, and the temperature output is probably used for something else as that temperature does not make sense.

@syssi
Copy link
Collaborator Author

syssi commented Feb 26, 2018

Could you try to set a float?

mirobo raw_command set_power_price "['49.51']"
mirobo raw_command get_prop "['power_price']"

@syssi
Copy link
Collaborator Author

syssi commented Feb 26, 2018

mirobo info

would be interesting too. Do you have the 1st or 2gen of the powerstrip?

@rytilahti
Copy link
Owner

It accepts floats, but rounds them down:

set_power_price "[48.51]"
Sending cmd set_power_price with params [48.51]
['ok']

Sending cmd get_prop with params ['power_price']
[48]

Values with quotes is not accepted and will result in Error: {'code': -5001, 'message': 'params err'}.
Maximum value is 999.

This is the v2 of zimi:

{'result': 
  {'token': '8523aaa7d78c8fb6eXXXX', 'mac': '28:6C:07:XX:XX:XX', 
   'ap': {'ssid': 'HomeNet', 'bssid': 'C2:6E:1F:XX:XX:XX', 'rssi': -61}, 
   'ott_stat': [0, 240086, 236, 0], 'hw_ver': 'MW300',
   'netif': {'gw': '192.168.250.1', 'localIp': '192.168.XX.XX', 'mask': '255.255.255.0'}, 'life': 903289,
   'otu_stat': [0, 0, 0, 0, 0, 0], 'fw_ver': '1.2.4_50', 'model': 'zimi.powerstrip.v2', 'cfg_time': 0, 'wifi_fw_ver': 'SD878x-14.76.36.p84-702.1.0-WM', 'mmfree': 15408
},

The power mode can be None.
@@ -87,3 +91,40 @@ def mode():
assert mode() == PowerMode.Eco
self.device.set_power_mode(PowerMode.Normal)
assert mode() == PowerMode.Normal

def test_status_without_mode(self):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redefinition of unused 'test_status_without_mode' from line 80

@syssi syssi merged commit c5091a2 into rytilahti:master Feb 27, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants