Skip to content

Commit

Permalink
River 2 Pro (API) - Unofficial
Browse files Browse the repository at this point in the history
  • Loading branch information
tolwi committed Sep 14, 2024
1 parent 44cb9b4 commit a0af486
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions custom_components/ecoflow_cloud/devices/public/river2_pro.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from .data_bridge import to_plain
from ..internal.river2_pro import River2Pro as InternalRiver2Pro
from ...api import EcoflowApiClient
from ...sensor import StatusSensorEntity


class River2Pro(InternalRiver2Pro):

def _prepare_data(self, raw_data) -> dict[str, any]:
res = super()._prepare_data(raw_data)
res = to_plain(res)
return res

def _status_sensor(self, client: EcoflowApiClient) -> StatusSensorEntity:
return StatusSensorEntity(client, self)
2 changes: 2 additions & 0 deletions custom_components/ecoflow_cloud/devices/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
delta2_max as public_delta2_max,
river2 as public_river2,
river2_max as public_river2_max,
river2_pro as public_river2_pro,
smart_plug as public_smart_plug,
powerstream as public_powerstream,
)
Expand Down Expand Up @@ -48,6 +49,7 @@
"DELTA 2 Max": public_delta2_max.Delta2Max,
"RIVER 2": public_river2.River2,
"RIVER 2 Max": public_river2_max.River2Max,
"RIVER 2 Pro": public_river2_pro.River2Pro,
"Smart Plug": public_smart_plug.SmartPlug,
"PowerStream": public_powerstream.PowerStream,
"Diagnostic": DiagnosticDevice
Expand Down

0 comments on commit a0af486

Please sign in to comment.