Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions homeassistant/components/plugwise/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,9 @@ def hvac_action(self):
if self._cooling_state:
return CURRENT_HVAC_COOL
return CURRENT_HVAC_IDLE
if self._heating_state is not None:
if self._setpoint > self._temperature:
return CURRENT_HVAC_HEAT
return CURRENT_HVAC_IDLE
if self._setpoint > self._temperature:
return CURRENT_HVAC_HEAT
return CURRENT_HVAC_IDLE

@property
def supported_features(self):
Expand All @@ -142,10 +141,9 @@ def preset_modes(self):
@property
def hvac_modes(self):
"""Return the available hvac modes list."""
if self._heating_state is not None:
if self._compressor_state is not None:
return HVAC_MODES_HEAT_COOL
return HVAC_MODES_HEAT_ONLY
if self._compressor_state is not None:
return HVAC_MODES_HEAT_COOL
return HVAC_MODES_HEAT_ONLY

@property
def hvac_mode(self):
Expand Down Expand Up @@ -263,11 +261,11 @@ def _async_process_data(self):
if heater_central_data.get("compressor_state") is not None:
self._compressor_state = heater_central_data["compressor_state"]

self._hvac_mode = HVAC_MODE_HEAT
if self._compressor_state is not None:
self._hvac_mode = HVAC_MODE_HEAT_COOL

if self._schema_status:
self._hvac_mode = HVAC_MODE_AUTO
elif self._heating_state is not None:
self._hvac_mode = HVAC_MODE_HEAT
if self._compressor_state is not None:
self._hvac_mode = HVAC_MODE_HEAT_COOL

self.async_write_ha_state()
2 changes: 1 addition & 1 deletion homeassistant/components/plugwise/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"domain": "plugwise",
"name": "Plugwise",
"documentation": "https://www.home-assistant.io/integrations/plugwise",
"requirements": ["Plugwise_Smile==1.5.1"],
"requirements": ["Plugwise_Smile==1.6.0"],
"codeowners": ["@CoMPaTech", "@bouwew"],
"zeroconf": ["_plugwise._tcp.local."],
"config_flow": true
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Mastodon.py==1.5.1
OPi.GPIO==0.4.0

# homeassistant.components.plugwise
Plugwise_Smile==1.5.1
Plugwise_Smile==1.6.0

# homeassistant.components.essent
PyEssent==0.13
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
HAP-python==3.0.0

# homeassistant.components.plugwise
Plugwise_Smile==1.5.1
Plugwise_Smile==1.6.0

# homeassistant.components.flick_electric
PyFlick==0.0.2
Expand Down
2 changes: 1 addition & 1 deletion tests/components/plugwise/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def mock_smile_adam():
return_value=True
)
smile_mock.return_value.single_master_thermostat.side_effect = Mock(
return_value=True
return_value=False
)
smile_mock.return_value.set_schedule_state.side_effect = AsyncMock(
return_value=True
Expand Down
4 changes: 2 additions & 2 deletions tests/components/plugwise/test_climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async def test_adam_climate_entity_attributes(hass, mock_smile_adam):
state = hass.states.get("climate.zone_lisa_wk")
attrs = state.attributes

assert attrs["hvac_modes"] is None
assert attrs["hvac_modes"] == ["heat", "auto"]

assert "preset_modes" in attrs
assert "no_frost" in attrs["preset_modes"]
Expand All @@ -29,7 +29,7 @@ async def test_adam_climate_entity_attributes(hass, mock_smile_adam):
state = hass.states.get("climate.zone_thermostat_jessie")
attrs = state.attributes

assert attrs["hvac_modes"] is None
assert attrs["hvac_modes"] == ["heat", "auto"]

assert "preset_modes" in attrs
assert "no_frost" in attrs["preset_modes"]
Expand Down