mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-04-10 22:05:07 +01:00
i18n groovy alignment for smartsense-moisture-sensor
This commit is contained in:
@@ -1,14 +1,40 @@
|
|||||||
|
#==============================================================================
|
||||||
# Generated on Wed Feb 24 14:28:26 CST 2016 by dylan
|
# Copyright 2016 SmartThings
|
||||||
'''Adjust temperature by this many degrees'''.ko=몇 도씩 온도를 조절하십시오
|
#
|
||||||
'''Degrees'''.ko=온도
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||||
'''Temperature Offset'''.ko=온도 직접 설정
|
# use this file except in compliance with the License. You may obtain a copy
|
||||||
'''This feature allows you to correct any temperature variations by selecting an offset. Ex: If your sensor consistently reports a temp that's 5 degrees too warm, you'd enter '-5'. If 3 degrees too cold, enter '+3'.'''.ko=기준 온도를 원하는대로 몇 도 올리거나 내려서 설정할 수 있습니다.
|
# of the License at:
|
||||||
'''battery'''.ko=배터리
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
#==============================================================================
|
||||||
|
# Purpose: SmartSense Moisture Sensor i18n Translation File
|
||||||
|
#
|
||||||
|
# Filename: SmartSense-Moisture-Sensor.src/i18n/messages.properties
|
||||||
|
#
|
||||||
|
# Change History:
|
||||||
|
# 1. 20160116 TW Initial release with formal Korean translation.
|
||||||
|
#==============================================================================
|
||||||
|
# Korean (ko)
|
||||||
|
# Device Preferences
|
||||||
'''dry'''.ko=건조
|
'''dry'''.ko=건조
|
||||||
'''wet'''.ko=누수
|
'''wet'''.ko=누수
|
||||||
'''{{ device.displayName }} battery has too much power: (> 3.5) volts.'''.ko={{ device.displayName }} 배터리 전력이 너무 높습니다(3.5볼트 초과).
|
'''battery'''.ko=배터리
|
||||||
'''{{ device.displayName }} battery was {{ value }}'''.ko={{ device.displayName }} 배터리가 {{ value }}였습니다
|
'''Temperature Offset'''.ko=온도 직접 설정
|
||||||
'''{{ device.displayName }} is {{ value | translate }}'''.ko={{ device.displayName }}이(가) {{ value | translate }}입니다
|
'''This feature allows you to correct any temperature variations by selecting an offset. Ex: If your sensor consistently reports a temp that's 5 degrees too warm, you'd enter '-5'. If 3 degrees too cold, enter '+3'.'''.ko=기준 온도를 원하는대로 몇 도 올리거나 내려서 설정할 수 있습니다.
|
||||||
|
'''Degrees'''.ko=온도
|
||||||
|
'''Adjust temperature by this many degrees'''.ko=몇 도씩 온도를 조절하십시오
|
||||||
|
'''Give your device a name'''.ko=장치 이름을 지정
|
||||||
|
# Events descriptionText
|
||||||
|
'''{{ device.displayName }} is dry'''.ko={{ device.displayName }}이(가) 마른 입니다
|
||||||
|
'''{{ device.displayName }} is wet'''.ko={{ device.displayName }}이(가) 젖은 입니다
|
||||||
'''{{ device.displayName }} was {{ value }}°C'''.ko={{ device.displayName }}이(가) {{ value }}°C였습니다
|
'''{{ device.displayName }} was {{ value }}°C'''.ko={{ device.displayName }}이(가) {{ value }}°C였습니다
|
||||||
'''{{ device.displayName }} was {{ value }}°F'''.ko={{ device.displayName }}이(가) {{ value }}°F였습니다
|
'''{{ device.displayName }} was {{ value }}°F'''.ko={{ device.displayName }}이(가) {{ value }}°F였습니다
|
||||||
|
'''{{ device.displayName }} battery has too much power: (> 3.5) volts.'''.ko={{ device.displayName }} 배터리 전력이 너무 높습니다(3.5볼트 초과).
|
||||||
|
'''{{ device.displayName }} battery was {{ value }}'''.ko={{ device.displayName }} 배터리 이었다 {{ value }}%
|
||||||
|
#==============================================================================
|
||||||
@@ -1,18 +1,29 @@
|
|||||||
/**
|
/*
|
||||||
* SmartSense Moisture Sensor
|
===============================================================================
|
||||||
|
* Copyright 2016 SmartThings
|
||||||
*
|
*
|
||||||
* Copyright 2014 SmartThings
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||||
*
|
* use this file except in compliance with the License. You may obtain a copy
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
* of the License at:
|
||||||
* in compliance with the License. You may obtain a copy of the License at:
|
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
* for the specific language governing permissions and limitations under the License.
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
* License for the specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
===============================================================================
|
||||||
|
* Purpose: SmartSense Moisture Sensor DTH File
|
||||||
*
|
*
|
||||||
|
* Filename: SmartSense-Moisture-Sensor.src/SmartSense-Moisture-Sensor.groovy
|
||||||
|
*
|
||||||
|
* Change History:
|
||||||
|
* 1. 20160116 TW - Update/Edit to support i18n translations
|
||||||
|
* 2. 20160125 TW = Incorporated new battery mapping from TM
|
||||||
|
===============================================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
definition (name: "SmartSense Moisture Sensor",namespace: "smartthings", author: "SmartThings") {
|
definition (name: "SmartSense Moisture Sensor",namespace: "smartthings", author: "SmartThings") {
|
||||||
capability "Configuration"
|
capability "Configuration"
|
||||||
@@ -23,7 +34,6 @@ metadata {
|
|||||||
|
|
||||||
command "enrollResponse"
|
command "enrollResponse"
|
||||||
|
|
||||||
|
|
||||||
fingerprint inClusters: "0000,0001,0003,0402,0500,0020,0B05", outClusters: "0019", manufacturer: "CentraLite", model: "3315-S", deviceJoinName: "Water Leak Sensor"
|
fingerprint inClusters: "0000,0001,0003,0402,0500,0020,0B05", outClusters: "0019", manufacturer: "CentraLite", model: "3315-S", deviceJoinName: "Water Leak Sensor"
|
||||||
fingerprint inClusters: "0000,0001,0003,0402,0500,0020,0B05", outClusters: "0019", manufacturer: "CentraLite", model: "3315"
|
fingerprint inClusters: "0000,0001,0003,0402,0500,0020,0B05", outClusters: "0019", manufacturer: "CentraLite", model: "3315"
|
||||||
fingerprint inClusters: "0000,0001,0003,0402,0500,0020,0B05", outClusters: "0019", manufacturer: "CentraLite", model: "3315-Seu", deviceJoinName: "Water Leak Sensor"
|
fingerprint inClusters: "0000,0001,0003,0402,0500,0020,0B05", outClusters: "0019", manufacturer: "CentraLite", model: "3315-Seu", deviceJoinName: "Water Leak Sensor"
|
||||||
@@ -43,7 +53,7 @@ metadata {
|
|||||||
])
|
])
|
||||||
}
|
}
|
||||||
section {
|
section {
|
||||||
input title: "Temperature Offset", description: "This feature allows you to correct any temperature variations by selecting an offset. Ex: If your sensor consistently reports a temp that's 5 degrees too warm, you'd enter \"-5\". If 3 degrees too cold, enter \"+3\".", displayDuringSetup: false, type: "paragraph", element: "paragraph"
|
input title: "Temperature Offset", description: "This feature allows you to correct any temperature variations by selecting an offset. Ex: If your sensor consistently reports a temp that's 5 degrees too warm, you'd enter '-5'. If 3 degrees too cold, enter '+3'.", displayDuringSetup: false, type: "paragraph", element: "paragraph"
|
||||||
input "tempOffset", "number", title: "Degrees", description: "Adjust temperature by this many degrees", range: "*..*", displayDuringSetup: false
|
input "tempOffset", "number", title: "Degrees", description: "Adjust temperature by this many degrees", range: "*..*", displayDuringSetup: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -56,7 +66,7 @@ metadata {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
valueTile("temperature", "device.temperature", inactiveLabel: false, width: 2, height: 2) {
|
valueTile("temperature", "device.temperature", inactiveLabel: false, width: 2, height: 2) {
|
||||||
state "temperature", label:'${currentValue}°',
|
state "temperature", label:'${currentValue}°',
|
||||||
backgroundColors:[
|
backgroundColors:[
|
||||||
[value: 31, color: "#153591"],
|
[value: 31, color: "#153591"],
|
||||||
[value: 44, color: "#1e9cbb"],
|
[value: 44, color: "#1e9cbb"],
|
||||||
@@ -220,7 +230,8 @@ private Map getBatteryResult(rawValue) {
|
|||||||
|
|
||||||
def result = [
|
def result = [
|
||||||
name: 'battery',
|
name: 'battery',
|
||||||
value: '--'
|
value: '--',
|
||||||
|
translatable: true
|
||||||
]
|
]
|
||||||
|
|
||||||
def volts = rawValue / 10
|
def volts = rawValue / 10
|
||||||
@@ -228,7 +239,7 @@ private Map getBatteryResult(rawValue) {
|
|||||||
if (rawValue == 0 || rawValue == 255) {}
|
if (rawValue == 0 || rawValue == 255) {}
|
||||||
else {
|
else {
|
||||||
if (volts > 3.5) {
|
if (volts > 3.5) {
|
||||||
result.descriptionText = "${linkText} battery has too much power (${volts} volts)."
|
result.descriptionText = "{{ device.displayName }} battery has too much power: (> 3.5) volts."
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (device.getDataValue("manufacturer") == "SmartThings") {
|
if (device.getDataValue("manufacturer") == "SmartThings") {
|
||||||
@@ -245,7 +256,8 @@ private Map getBatteryResult(rawValue) {
|
|||||||
def pct = batteryMap[volts]
|
def pct = batteryMap[volts]
|
||||||
if (pct != null) {
|
if (pct != null) {
|
||||||
result.value = pct
|
result.value = pct
|
||||||
result.descriptionText = "${linkText} battery was ${result.value}%"
|
def value = pct
|
||||||
|
result.descriptionText = "{{ device.displayName }} battery was {{ value }}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -253,37 +265,46 @@ private Map getBatteryResult(rawValue) {
|
|||||||
def maxVolts = 3.0
|
def maxVolts = 3.0
|
||||||
def pct = (volts - minVolts) / (maxVolts - minVolts)
|
def pct = (volts - minVolts) / (maxVolts - minVolts)
|
||||||
result.value = Math.min(100, (int) pct * 100)
|
result.value = Math.min(100, (int) pct * 100)
|
||||||
result.descriptionText = "${linkText} battery was ${result.value}%"
|
result.descriptionText = "{{ device.displayName }} battery was {{ value }}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map getTemperatureResult(value) {
|
private Map getTemperatureResult(value) {
|
||||||
log.debug 'TEMP'
|
log.debug 'TEMP'
|
||||||
def linkText = getLinkText(device)
|
|
||||||
if (tempOffset) {
|
if (tempOffset) {
|
||||||
def offset = tempOffset as int
|
def offset = tempOffset as int
|
||||||
def v = value as int
|
def v = value as int
|
||||||
value = v + offset
|
value = v + offset
|
||||||
}
|
}
|
||||||
def descriptionText = "${linkText} was ${value}°${temperatureScale}"
|
def descriptionText
|
||||||
|
if ( temperatureScale == 'C' )
|
||||||
|
descriptionText = '{{ device.displayName }} was {{ value }}°C'
|
||||||
|
else
|
||||||
|
descriptionText = '{{ device.displayName }} was {{ value }}°F'
|
||||||
|
|
||||||
return [
|
return [
|
||||||
name: 'temperature',
|
name: 'temperature',
|
||||||
value: value,
|
value: value,
|
||||||
descriptionText: descriptionText
|
descriptionText: descriptionText,
|
||||||
|
translatable: true
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map getMoistureResult(value) {
|
private Map getMoistureResult(value) {
|
||||||
log.debug 'water'
|
log.debug "water"
|
||||||
String descriptionText = "${device.displayName} is ${value}"
|
def descriptionText
|
||||||
|
if ( value == "wet" )
|
||||||
|
descriptionText = '{{ device.displayName }} is wet'
|
||||||
|
else
|
||||||
|
descriptionText = '{{ device.displayName }} is dry'
|
||||||
return [
|
return [
|
||||||
name: 'water',
|
name: 'water',
|
||||||
value: value,
|
value: value,
|
||||||
descriptionText: descriptionText
|
descriptionText: descriptionText,
|
||||||
|
translatable: true
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user