Skip to content

Commit

Permalink
Merge pull request #1062 from SmartThingsCommunity/beta
Browse files Browse the repository at this point in the history
Rolling up beta to production
  • Loading branch information
greens authored Nov 7, 2023
2 parents 6834974 + 1947aff commit 2040029
Show file tree
Hide file tree
Showing 9 changed files with 792 additions and 98 deletions.
2 changes: 1 addition & 1 deletion drivers/SmartThings/matter-thermostat/src/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ local THERMOSTAT_MODE_MAP = {
[clusters.Thermostat.types.ThermostatSystemMode.COOL] = capabilities.thermostatMode.thermostatMode.cool,
[clusters.Thermostat.types.ThermostatSystemMode.HEAT] = capabilities.thermostatMode.thermostatMode.heat,
[clusters.Thermostat.types.ThermostatSystemMode.EMERGENCY_HEATING] = capabilities.thermostatMode.thermostatMode.emergency_heat,
[clusters.Thermostat.types.ThermostatSystemMode.FAN_ONLY] = capabilities.thermostatMode.thermostatMode.fanOnly
[clusters.Thermostat.types.ThermostatSystemMode.FAN_ONLY] = capabilities.thermostatMode.thermostatMode.fanonly
}

local THERMOSTAT_OPERATING_MODE_MAP = {
Expand Down
34 changes: 30 additions & 4 deletions drivers/SmartThings/samsung-audio/src/command.lua
Original file line number Diff line number Diff line change
Expand Up @@ -348,14 +348,40 @@ function Command.getPlayStatus(ip)
return response_map
end

--- Return err code from xml handler or nil if it doesn't exist
local get_err_code = function(response_map)
if response_map ~= nil and
response_map.handler_res~= nil and
response_map.handler_res.root ~= nil and
response_map.handler_res.root.UIC ~= nil and
response_map.handler_res.root.UIC.response ~= nil then
return response_map.handler_res.root.UIC.response.errCode
else
return nil
end

end

local format_streaming_path = function(uri)
return "/UIC?cmd=%3Cpwron%3Eon%3C/pwron%3E%3Cname%3ESetUrlPlayback%3C/name%3E%3Cp%20type=%22cdata%22%20name=%22url%22%20val=%22empty%22%3E%3C![CDATA[" .. uri .. "]]%3E%3C/p%3E%3Cp%20type=%22dec%22%20name=%22buffersize%22%20val=%220%22/%3E%3Cp%20type=%22dec%22%20name=%22seektime%22%20val=%220%22/%3E%3Cp%20type=%22dec%22%20name=%22resume%22%20val=%221%22/%3E"
end

function Command.play_streaming_uri(ip, uri)
log.trace("Triggering UPnP Command Request for [Audio Notification -> SetUrlPlayback]")
local response_map = nil
if ip then
local path = "/UIC?cmd=%3Cpwron%3Eon%3C/pwron%3E%3Cname%3ESetUrlPlayback%3C/name%3E%3Cp%20type=%22cdata%22%20name=%22url%22%20val=%22empty%22%3E%3C![CDATA[" .. uri .. "]]%3E%3C/p%3E%3Cp%20type=%22dec%22%20name=%22buffersize%22%20val=%220%22/%3E%3Cp%20type=%22dec%22%20name=%22seektime%22%20val=%220%22/%3E%3Cp%20type=%22dec%22%20name=%22resume%22%20val=%221%22/%3E"
local url = format_url(ip, path)
log.trace(string.format("Final Notification Command URL for making Audio Notification http request = %s", url))
response_map = handle_http_request(ip, url)
local path = format_streaming_path(uri)
local url = format_url(ip, path)
log.trace(string.format("Final Notification Command URL for making Audio Notification http request = %s", url))
response_map = handle_http_request(ip, url)
local err_code = get_err_code(response_map)
if err_code == "URL_OPEN_FAIL" then
uri = string.gsub(uri, "https://", "http://")
local path = format_streaming_path(uri)
local url = format_url(ip, path)
log.info(string.format("Falling back to http for AudioNotification Command %s", url))
response_map = handle_http_request(ip, url)
end
end
return response_map
end
Expand Down
9 changes: 7 additions & 2 deletions drivers/SmartThings/zigbee-thermostat/fingerprints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,15 @@ zigbeeManufacturer:
model: eTRV0100
deviceProfileName: thermostat-popp-danfoss
- id: "D5X84YU/eT093WRO"
deviceLabel: POPP Thermostat
deviceLabel: POPP Smart Thermostat (Zigbee)
manufacturer: D5X84YU
model: eT093WRO
deviceProfileName: thermostat-popp-danfoss
deviceProfileName: thermostat-popp
- id: "D5X84YU/eT093WRG"
deviceLabel: POPP Smart Thermostat (Zigbee)
manufacturer: D5X84YU
model: eT093WRG
deviceProfileName: thermostat-popp
- id: "Zen Within/Zen-01"
deviceLabel: Zen Thermostat
manufacturer: Zen Within
Expand Down
71 changes: 71 additions & 0 deletions drivers/SmartThings/zigbee-thermostat/profiles/thermostat-popp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: thermostat-popp
components:
- id: main
capabilities:
- id: thermostatHeatingSetpoint
version: 1
- id: thermostatMode
version: 1
- id: temperatureMeasurement
version: 1
- id: switch
version: 1
- id: temperatureAlarm
version: 1
- id: battery
version: 1
- id: firmwareUpdate
version: 1
- id: refresh
version: 1
categories:
- name: Thermostat
preferences:
- preferenceId: tempOffset
explicit: true
- name: "keypadLock"
title: "Child lock"
description: "Enable or disable the child lock of the Smart Thermostat."
required: false
preferenceType: enumeration
definition:
options:
0: "Unlock"
1: "Lock"
default: 0
- name: "viewingDirection"
title: "Viewing Direction"
description: "Change LCD screen viewing direction of the Smart Thermostat"
required: false
preferenceType: enumeration
definition:
options:
0: ""
1: "180°"
default: 0
- name: "eTRVOrientation"
title: "Vertical Orientation"
description: "Change the orientation of the Smart Thermostat"
required: false
preferenceType: boolean
definition:
default: true
- name: "regulationSetPointOffset"
title: "Regulation of the SetPoint Offset"
description: "Change the SetPoint Offset of the Smart Thermostat"
required: false
preferenceType: number
definition:
minimum: -2.5
maximum: 2.5
default: 0
- name: "windowOpenFeature"
title: "Window open detection"
description: "En- or Disable the Window open detection"
required: false
preferenceType: boolean
definition:
default: true
metadata:
mnmn: SmartThingsCommunity
vid: 53317f80-5bed-3190-a1d6-461a0343066c
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@ local clusters = require "st.zigbee.zcl.clusters"
local battery_defaults = require "st.zigbee.defaults.battery_defaults"
local PowerConfiguration = clusters.PowerConfiguration

local POPP_DANFOSS_THERMOSTAT_FINGERPRINTS = {
{ mfr = "D5X84YU", model = "eT093WRO" },
local DANFOSS_THERMOSTAT_FINGERPRINTS = {
{ mfr = "Danfoss", model = "eTRV0100" }
}

local is_popp_danfoss_thermostat = function(opts, driver, device)
for _, fingerprint in ipairs(POPP_DANFOSS_THERMOSTAT_FINGERPRINTS) do
local is_danfoss_thermostat = function(opts, driver, device)
for _, fingerprint in ipairs(DANFOSS_THERMOSTAT_FINGERPRINTS) do
if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then
return true
end
end
return false
end

local popp_danfoss_thermostat = {
NAME = "POPP Danfoss Thermostat Handler",
local danfoss_thermostat = {
NAME = "Danfoss Thermostat Handler",
zigbee_handlers = {
attr = {
[PowerConfiguration.ID] = {
Expand All @@ -28,7 +27,7 @@ local popp_danfoss_thermostat = {
lifecycle_handlers = {
init = battery_defaults.build_linear_voltage_init(2.4, 3.2)
},
can_handle = is_popp_danfoss_thermostat
can_handle = is_danfoss_thermostat
}

return popp_danfoss_thermostat
return danfoss_thermostat
3 changes: 2 additions & 1 deletion drivers/SmartThings/zigbee-thermostat/src/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,8 @@ local zigbee_thermostat_driver = {
require("stelpro"),
require("lux-konoz"),
require("leviton"),
require("popp_danfoss"),
require("danfoss"),
require("popp"),
require("vimar")
},
}
Expand Down
Loading

0 comments on commit 2040029

Please sign in to comment.