-
Notifications
You must be signed in to change notification settings - Fork 89.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ICP-13246] Stelpro Thermostats preferences changes #32881
Changes from 7 commits
c45ea1d
3143e9e
d8f6136
2f659a6
7da6f0a
7077e0e
a9eaeaf
c798dc7
7b401eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,11 +50,12 @@ metadata { | |
|
||
preferences { | ||
section { | ||
input("heatdetails", "enum", title: "Do you want a detailed operating state notification?", options: ["No", "Yes"], defaultValue: "No", required: true, displayDuringSetup: true) | ||
input("heatdetails", "enum", title: "Do you want to see detailed operating state events in the activity history? There may be many.", options: ["No", "Yes"], defaultValue: "No", required: false, displayDuringSetup: true) | ||
} | ||
section { | ||
input title: "Outdoor Temperature", description: "To get the current outdoor temperature to display on your thermostat enter your zip code or postal code below and make sure that your SmartThings location has a Geolocation configured (typically used for geofencing).", displayDuringSetup: false, type: "paragraph", element: "paragraph" | ||
input("zipcode", "text", title: "ZipCode (Outdoor Temperature)", description: "[Do not use space](Blank = No Forecast)") | ||
input(title: "Outdoor Temperature", description: "To get the current outdoor temperature to display on your thermostat enter your zip code or postal code below and make sure that your SmartThings location has a Geolocation configured (typically used for geofencing). Do not use space. If you don't want a forecast, leave it blank.", | ||
displayDuringSetup: false, type: "paragraph", element: "paragraph") | ||
input("zipcode", "text", title: "ZipCode (Outdoor Temperature)", description: "") | ||
} | ||
} | ||
|
||
|
@@ -290,7 +291,7 @@ def zwaveEvent(thermostatsetpointv2.ThermostatSetpointReport cmd) { | |
def map = [:] | ||
|
||
if (cmd.scaledValue >= 327 || | ||
cmd.setpointType != thermostatsetpointv2.ThermostatSetpointReport.SETPOINT_TYPE_HEATING_1) { | ||
cmd.setpointType != thermostatsetpointv2.ThermostatSetpointReport.SETPOINT_TYPE_HEATING_1) { | ||
return [:] | ||
} | ||
temp = convertTemperatureIfNeeded(cmd.scaledValue, cmdScale, cmd.precision) | ||
|
@@ -366,7 +367,10 @@ def zwaveEvent(thermostatoperatingstatev1.ThermostatOperatingStateReport cmd) { | |
map.name = "thermostatOperatingState" | ||
map.value = operatingState | ||
|
||
if (settings.heatdetails == "No") { | ||
// If the user want to see each of the Idle and Heating events in the event history, | ||
// Otherwise don't show them more frequently than 5 minutes. | ||
if (settings.heatdetails == "No" || | ||
!secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 60 * 5)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, it isn't in this DTH. It is in the Zigbee and Maestro ones down at the bottom of the file. @PKacprowiczS You'll need to copy |
||
map.displayed = false | ||
} | ||
} else { | ||
|
@@ -556,3 +560,25 @@ def fanCirculate() { | |
def setThermostatFanMode() { | ||
log.trace "${device.displayName} does not support fan mode" | ||
} | ||
|
||
/** | ||
* Checks if the time elapsed from the provided timestamp is greater than the number of senconds provided | ||
* | ||
* @param timestamp: The timestamp | ||
* | ||
* @param seconds: The number of seconds | ||
* | ||
* @returns true if elapsed time is greater than number of seconds provided, else false | ||
*/ | ||
private Boolean secondsPast(timestamp, seconds) { | ||
if (!(timestamp instanceof Number)) { | ||
if (timestamp instanceof Date) { | ||
timestamp = timestamp.time | ||
} else if ((timestamp instanceof String) && timestamp.isNumber()) { | ||
timestamp = timestamp.toLong() | ||
} else { | ||
return true | ||
} | ||
} | ||
return (now() - timestamp) > (seconds * 1000) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,11 +53,11 @@ metadata { | |
preferences { | ||
section { | ||
input("lock", "enum", title: "Do you want to lock your thermostat's physical keypad?", options: ["No", "Yes"], defaultValue: "No", required: false, displayDuringSetup: false) | ||
input("heatdetails", "enum", title: "Do you want a detailed operating state notification?", options: ["No", "Yes"], defaultValue: "No", required: false, displayDuringSetup: true) | ||
input("heatdetails", "enum", title: "Do you want to see detailed operating state events in the activity history? There may be many.", options: ["No", "Yes"], defaultValue: "No", required: false, displayDuringSetup: true) | ||
} | ||
section { | ||
input title: "Outdoor Temperature", description: "To get the current outdoor temperature to display on your thermostat enter your zip code or postal code below and make sure that your SmartThings location has a Geolocation configured (typically used for geofencing).", displayDuringSetup: false, type: "paragraph", element: "paragraph" | ||
input("zipcode", "text", title: "ZipCode (Outdoor Temperature)", description: "[Do not use space](Blank = No Forecast)") | ||
section {input(title: "Outdoor Temperature", description: "To get the current outdoor temperature to display on your thermostat enter your zip code or postal code below and make sure that your SmartThings location has a Geolocation configured (typically used for geofencing). Do not use space. If you don't want a forecast, leave it blank.", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure you meant to have this on the same line as the |
||
displayDuringSetup: false, type: "paragraph", element: "paragraph") | ||
input("zipcode", "text", title: "ZipCode (Outdoor Temperature)", description: "") | ||
} | ||
} | ||
|
||
|
@@ -307,10 +307,10 @@ def parse(String description) { | |
map.value = "heating" | ||
} | ||
|
||
// If the user does not want to see the Idle and Heating events in the event history, | ||
// don't show them. Otherwise, don't show them more frequently than 30 seconds. | ||
// If the user want to see each of the Idle and Heating events in the event history, | ||
// Otherwise don't show them more frequently than 5 minutes. | ||
if (settings.heatdetails == "No" || | ||
!secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 30)) { | ||
!secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 60 * 5)) { | ||
map.displayed = false | ||
} | ||
map = validateOperatingStateBugfix(map) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,11 +54,11 @@ metadata { | |
preferences { | ||
section { | ||
input("lock", "enum", title: "Do you want to lock your thermostat's physical keypad?", options: ["No", "Yes"], defaultValue: "No", required: false, displayDuringSetup: false) | ||
input("heatdetails", "enum", title: "Do you want a detailed operating state notification?", options: ["No", "Yes"], defaultValue: "No", required: false, displayDuringSetup: true) | ||
input("heatdetails", "enum", title: "Do you want to see detailed operating state events in the activity history? There may be many.", options: ["No", "Yes"], defaultValue: "No", required: false, displayDuringSetup: true) | ||
} | ||
section { | ||
input title: "Outdoor Temperature", description: "To get the current outdoor temperature to display on your thermostat enter your zip code or postal code below and make sure that your SmartThings location has a Geolocation configured (typically used for geofencing).", displayDuringSetup: false, type: "paragraph", element: "paragraph" | ||
input("zipcode", "text", title: "ZipCode (Outdoor Temperature)", description: "[Do not use space](Blank = No Forecast)") | ||
section {input(title: "Outdoor Temperature", description: "To get the current outdoor temperature to display on your thermostat enter your zip code or postal code below and make sure that your SmartThings location has a Geolocation configured (typically used for geofencing). Do not use space. If you don't want a forecast, leave it blank.", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above: Not sure you meant to have this on the same line as the |
||
displayDuringSetup: false, type: "paragraph", element: "paragraph") | ||
input("zipcode", "text", title: "ZipCode (Outdoor Temperature)", description: "") | ||
} | ||
/* | ||
input("away_setpoint", "enum", title: "Away setpoint", options: ["5", "5.5", "6", "6.5", "7", "7.5", "8", "8.5", "9", "9.5", "10", "10.5", "11", "11.5", "12", "12.5", "13", "13.5", "14", "14.5", "15", "5.5", "15.5", "16", "16.5", "17", "17.5", "18", "18.5", "19", "19.5", "20", "20.5", "21", "21.5", "22", "22.5", "23", "24", "24.5", "25", "25.5", "26", "26.5", "27", "27.5", "28", "28.5", "29", "29.5", "30"], defaultValue: "21", required: true) | ||
|
@@ -278,10 +278,10 @@ def parse(String description) { | |
map.value = "heating" | ||
} | ||
|
||
// If the user does not want to see the Idle and Heating events in the event history, | ||
// don't show them. Otherwise, don't show them more frequently than 30 seconds. | ||
// If the user want to see each of the Idle and Heating events in the event history, | ||
// Otherwise don't show them more frequently than 5 minutes. | ||
if (settings.heatdetails == "No" || | ||
!secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 30)) { | ||
!secondsPast(device.currentState("thermostatOperatingState")?.getLastUpdated(), 60 * 5)) { | ||
map.displayed = false | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a little bit of nit-picking for this comment and the other two below:
If the user wants
andhistory, otherwise
.