Skip to content

ECO mode always returns None #3

@SteveFelker

Description

@SteveFelker

Let me start by saying thank you for this great tool!

As I was testing it, I found that DeviceProperties eco_mode always returns "None" when querying an F3000LFP whether ECO mode is enabled or disabled. Since None is simply an unset boolean, this is most likely a code error here due to not setting the value correctly, or not handling an error for missing data from the Pecron. Further supporting this is the fact that eco_onoff_us reports correctly in the "raw" data returned when using this code:

from unofficial_pecron_api import PecronAPI
with PecronAPI(region="US") as api:
api.login("user", "password")
for device in api.get_devices():
props = api.get_device_properties(device)
eco_enabled=[d['resourceValce'] for d in props.raw if d['resourceCode'] == 'eco_onoff_us'][0]
print(f"ECO_Enabled: {eco_enabled}")

Incidentally, I am not sure if all of the "resourceValce" dictionary names in the raw section are a typo on the Pecron side or in this code, or if Valce maybe does mean something?

And finally, it appears that remain_charging_time and remain_discharging_time are returning correctly now - at least with firmware "WIFI01R13A04_OCPU_QTH_MCU_2.1.0". When charging, the remain_discharging_time is 5994, and when not charging, the remain_charging_time is zero.

Thanks again for a great tool.
Steve

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions