1+ from custom_components .ecoflow_cloud .api import EcoflowApiClient
2+ from custom_components .ecoflow_cloud .devices import const , BaseDevice
3+ from custom_components .ecoflow_cloud .entities import BaseSensorEntity , BaseNumberEntity , BaseSwitchEntity , \
4+ BaseSelectEntity
5+ from custom_components .ecoflow_cloud .sensor import WattsSensorEntity ,LevelSensorEntity ,CapacitySensorEntity , \
6+ InWattsSensorEntity ,OutWattsSensorEntity , RemainSensorEntity , MilliVoltSensorEntity , TempSensorEntity , \
7+ CyclesSensorEntity
8+
9+ class StreamAC (BaseDevice ):
10+ def sensors (self , client : EcoflowApiClient ) -> list [BaseSensorEntity ]:
11+ return [
12+
13+ WattsSensorEntity (client , self , "sysGridConnectionPower" , const .STREAM_POWER_AC_SYS ),
14+ WattsSensorEntity (client , self , "powGetSysLoad" , const .STREAM_GET_SYS_LOAD ),
15+ WattsSensorEntity (client , self , "powGetSysLoadFromGrid" , const .STREAM_GET_SYS_LOAD_FROM_GRID ),
16+ WattsSensorEntity (client , self , "powGetSchuko1" , const .STREAM_GET_SCHUKO1 , False ),
17+ WattsSensorEntity (client , self , "powGetSchuko2" , const .STREAM_GET_SCHUKO2 , False ),
18+ WattsSensorEntity (client , self , "gridConnectionPower" , const .STREAM_POWER_AC ),
19+ WattsSensorEntity (client , self , "powGetSysGrid" , const .STREAM_POWER_GRID ),
20+ WattsSensorEntity (client , self , "powGetPvSum" , const .STREAM_POWER_PV ),
21+ WattsSensorEntity (client , self , "powGetBpCms" , const .STREAM_POWER_BATTERY ),
22+ LevelSensorEntity (client , self , "f32ShowSoc" , const .STREAM_POWER_BATTERY_SOC ),
23+ LevelSensorEntity (client , self , "soc" , const .STREAM_POWER_BATTERY )
24+ .attr ("designCap" , const .ATTR_DESIGN_CAPACITY , 0 )
25+ .attr ("fullCap" , const .ATTR_FULL_CAPACITY , 0 )
26+ .attr ("remainCap" , const .ATTR_REMAIN_CAPACITY , 0 ),
27+ CapacitySensorEntity (client , self , "designCap" , const .STREAM_DESIGN_CAPACITY ,False ),
28+ CapacitySensorEntity (client , self , "fullCap" , const .STREAM_FULL_CAPACITY , False ),
29+ CapacitySensorEntity (client , self , "remainCap" , const .STREAM_REMAIN_CAPACITY ,False ),
30+
31+ MilliVoltSensorEntity (client , self , "vol" , const .BATTERY_VOLT , False )
32+ .attr ("minCellVol" , const .ATTR_MIN_CELL_VOLT , 0 )
33+ .attr ("maxCellVol" , const .ATTR_MAX_CELL_VOLT , 0 ),
34+ MilliVoltSensorEntity (client , self , "minCellVol" , const .MIN_CELL_VOLT , False ),
35+ MilliVoltSensorEntity (client , self , "maxCellVol" , const .MAX_CELL_VOLT , False ),
36+ LevelSensorEntity (client , self , "soh" , const .SOH ),
37+
38+ TempSensorEntity (client , self , "temp" , const .BATTERY_TEMP )
39+ .attr ("minCellTemp" , const .ATTR_MIN_CELL_TEMP , 0 )
40+ .attr ("maxCellTemp" , const .ATTR_MAX_CELL_TEMP , 0 ),
41+ TempSensorEntity (client , self , "minCellTemp" , const .MIN_CELL_TEMP , False ),
42+ TempSensorEntity (client , self , "maxCellTemp" , const .MAX_CELL_TEMP , False ),
43+
44+ CyclesSensorEntity (client , self , "cycles" , const .CYCLES ),
45+
46+ InWattsSensorEntity (client , self , "inputWatts" , const .STREAM_IN_POWER ),
47+ OutWattsSensorEntity (client , self , "outputWatts" , const .STREAM_OUT_POWER ),
48+
49+ RemainSensorEntity (client , self , "remainTime" , const .REMAINING_TIME ),
50+ ]
51+ # moduleWifiRssi
52+ def numbers (self , client : EcoflowApiClient ) -> list [BaseNumberEntity ]:
53+ return []
54+
55+ def switches (self , client : EcoflowApiClient ) -> list [BaseSwitchEntity ]:
56+ return []
57+
58+ def selects (self , client : EcoflowApiClient ) -> list [BaseSelectEntity ]:
59+ return []
0 commit comments