mirror of
https://github.com/home-assistant/core
synced 2024-09-12 15:16:21 +02:00
Revert "Fix broken maxcube component" (#42859)
This reverts commit 898f50386f
.
This commit is contained in:
parent
b1ed5a3e79
commit
f6751de262
@ -16,7 +16,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
name = f"{cube.room_by_id(device.room_id).name} {device.name}"
|
||||
|
||||
# Only add Window Shutters
|
||||
if device.is_windowshutter():
|
||||
if cube.is_windowshutter(device):
|
||||
devices.append(MaxCubeShutter(handler, name, device.rf_address))
|
||||
|
||||
if devices:
|
||||
|
@ -70,7 +70,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
for device in cube.devices:
|
||||
name = f"{cube.room_by_id(device.room_id).name} {device.name}"
|
||||
|
||||
if device.is_thermostat() or device.is_wallthermostat():
|
||||
if cube.is_thermostat(device) or cube.is_wallthermostat(device):
|
||||
devices.append(MaxCubeClimate(handler, name, device.rf_address))
|
||||
|
||||
if devices:
|
||||
@ -180,11 +180,11 @@ class MaxCubeClimate(ClimateEntity):
|
||||
device = cube.device_by_rf(self._rf_address)
|
||||
valve = 0
|
||||
|
||||
if device.is_thermostat():
|
||||
if cube.is_thermostat(device):
|
||||
valve = device.valve_position
|
||||
elif device.is_wallthermostat():
|
||||
elif cube.is_wallthermostat(device):
|
||||
for device in cube.devices_by_room(cube.room_by_id(device.room_id)):
|
||||
if device.is_thermostat() and device.valve_position > 0:
|
||||
if cube.is_thermostat(device) and device.valve_position > 0:
|
||||
valve = device.valve_position
|
||||
break
|
||||
else:
|
||||
@ -287,7 +287,7 @@ class MaxCubeClimate(ClimateEntity):
|
||||
cube = self._cubehandle.cube
|
||||
device = cube.device_by_rf(self._rf_address)
|
||||
|
||||
if not device.is_thermostat():
|
||||
if not cube.is_thermostat(device):
|
||||
return {}
|
||||
return {ATTR_VALVE_POSITION: device.valve_position}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user