23
23
VARIABLE_PARTY_MODE ,
24
24
VARIABLE_PARTY_MODE_FAN_STAGE ,
25
25
VARIABLE_PARTY_MODE_DURATION ,
26
- VARIABLE_PERCENTAGE_FAN_SPEED ,
26
+ VARIABLE_SUPPLY_AIR_RPM ,
27
+ VARIABLE_EXTRACT_AIR_RPM ,
27
28
VARIABLE_STANDBY_MODE
28
29
)
29
30
@@ -42,7 +43,8 @@ def __init__(self, hass, controller: ThreadSafeController, name: str):
42
43
self ._controller = controller
43
44
self ._name = name
44
45
self ._fan_stage = None
45
- self ._percentage_fan_speed = None
46
+ self ._supply_air_rpm = None
47
+ self ._extract_air_rpm = None
46
48
self ._attributes = {}
47
49
48
50
@property
@@ -89,7 +91,8 @@ def speed(self):
89
91
90
92
@property
91
93
def is_on (self ):
92
- return not self ._percentage_fan_speed is None and self ._percentage_fan_speed > 0
94
+ return ((not self ._supply_air_rpm is None and self ._supply_air_rpm > 0 ) or
95
+ (not self ._extract_air_rpm is None and self ._extract_air_rpm > 0 ))
93
96
94
97
async def async_set_speed (self , speed : str ):
95
98
self ._controller .set_variable (
@@ -125,7 +128,8 @@ def start_party_mode(self, speed: str, duration: int):
125
128
return
126
129
127
130
self ._controller .set_variable (
128
- VARIABLE_PARTY_MODE_FAN_STAGE , self .speed_list .index (speed ) + 1 , "{:d}"
131
+ VARIABLE_PARTY_MODE_FAN_STAGE , self .speed_list .index (
132
+ speed ) + 1 , "{:d}"
129
133
)
130
134
self ._controller .set_variable (
131
135
VARIABLE_PARTY_MODE_DURATION , duration , "{:d}"
@@ -135,10 +139,8 @@ def start_party_mode(self, speed: str, duration: int):
135
139
)
136
140
137
141
async def async_update (self ):
138
- self ._percentage_fan_speed = float (
139
- self ._controller .get_variable (
140
- VARIABLE_PERCENTAGE_FAN_SPEED , 8 , float )
141
- )
142
+ self ._supply_air_rpm = self ._controller .get_variable (VARIABLE_SUPPLY_AIR_RPM , 8 , float )
143
+ self ._extract_air_rpm = self ._controller .get_variable (VARIABLE_EXTRACT_AIR_RPM , 8 , float )
142
144
self ._fan_stage = int (
143
145
self ._controller .get_variable (VARIABLE_FAN_STAGE , 1 , int ))
144
146
@@ -184,6 +186,7 @@ async def async_update(self):
184
186
"operation_mode" : operation_mode
185
187
}
186
188
189
+
187
190
async def async_setup_entry (hass , entry , async_add_entities ):
188
191
_LOGGER .info ("Setting up Helios EasyControls fan device." )
189
192
0 commit comments