Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Device parameters do not refresh #4

Open
PJanisio opened this issue Jul 10, 2022 · 2 comments
Open

Device parameters do not refresh #4

PJanisio opened this issue Jul 10, 2022 · 2 comments

Comments

@PJanisio
Copy link

Hi,

Some of sonoff devices has additional parameters, like mine: voltage, power, current.
These are not being refreshed during getting device and checking parameters.

office_socket = client.get_device('100142b205')
    device_name_office = (office_socket.name)
    office_socket_power = (office_socket.params.power)
    office_socket_voltage = (office_socket.params.voltage)

I think its not a issue with the code, because in the ewelink app or ewelink-web it also do not refresh very often (in ewelink web you can forcely refresh the data). So in this case its a feature request, if possible to update the parameters every time connecting the device.

@PJanisio
Copy link
Author

I moved back to the topic and found solution (worth to mention in readme).
Apart from .get_device its better to fetch device.data which automatically updates devices status.

Example of my device:

office_socket = client.get_device('100142b205')
    
    data = office_socket.data
    
    device_name_office = (office_socket.name)
    office_socket_switch = (office_socket.params.switch)
    office_socket_status = (office_socket.params.sledOnline)
    office_socket_power = data['params']['power']
    office_socket_voltage = data['params']['voltage']
    office_socket_current = data['params']['current']

Closing.

@PJanisio
Copy link
Author

Nope. That was a coincidence. Still "low level" parameters like voltage, current and power are not refreshing themselves...

@PJanisio PJanisio reopened this May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant