Skip to content

Commit

Permalink
Merge pull request #141 from AaronLionsheep/issue-140
Browse files Browse the repository at this point in the history
Preserve previous TRV schedule names
  • Loading branch information
AaronLionsheep authored Oct 3, 2023
2 parents d0c6659 + 6d3f636 commit a379f61
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ShellyMQTT.indigoPlugin/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>PluginVersion</key>
<string>1.0.1</string>
<string>1.0.2</string>
<key>ServerApiVersion</key>
<string>3.0</string>
<key>IwsApiVersion</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ def processThermostat(self, thermostat):
valve_position = thermostat.get("pos", None)
schedule = thermostat.get("schedule", False)
schedule_profile = thermostat.get("schedule_profile")
self.schedule_profile_names = thermostat.get("schedule_profile_names", [])
schedule_profile_names = thermostat.get("schedule_profile_names", None)

if schedule_profile_names is not None:
self.schedule_profile_names = schedule_profile_names

if target_temperature is not None:
if self.device.pluginProps.get("temp-units", "C") == "F":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ def test_trv_stores_schedule_profile_names(self):
}
self.assertEqual(expected, self.shelly.get_schedule_profiles())

def test_trv_does_not_clear_missing_schedule_profiles(self):
self.shelly.schedule_profile_names = ["A", "B", "C", "D", "E"]
self.shelly.handleMessage("shellies/trv/settings", '{"thermostats": [{}]}')
self.assertEqual(["A", "B", "C", "D", "E"], self.shelly.schedule_profile_names)

def test_trv_default_schedule_profile_names(self):
expected = {
1: None,
Expand Down

0 comments on commit a379f61

Please sign in to comment.