mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-04-01 14:23:07 +01:00
create i18n korean translation for smartpower-outlet
This commit is contained in:
@@ -0,0 +1,30 @@
|
|||||||
|
#==============================================================================
|
||||||
|
# Copyright 2016 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
|
||||||
|
# of the License at:
|
||||||
|
#
|
||||||
|
# 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: SmartPower Outlet i18n Translation File
|
||||||
|
#
|
||||||
|
# Filename: SmartPower-Outlet.src/i18n/messages.properties
|
||||||
|
#
|
||||||
|
# Change History:
|
||||||
|
# 1. 20160116 TW Initial release with informal Korean translation.
|
||||||
|
#==============================================================================
|
||||||
|
# Korean (ko)
|
||||||
|
# Device Preferences
|
||||||
|
'''Give your device a name'''.ko=장치 이름을 지정
|
||||||
|
# Events descriptionText
|
||||||
|
'''{{ device.displayName }} is On'''.ko={{ device.displayName }} 에 있다
|
||||||
|
'''{{ device.displayName }} is Off'''.ko={{ device.displayName }} 꺼져
|
||||||
|
'''{{ device.displayName }} power is {{ value }} Watts'''.ko={{ device.displayName }} 힘 이다 {{ value }} 와트
|
||||||
|
#==============================================================================
|
||||||
@@ -1,20 +1,28 @@
|
|||||||
/**
|
/*
|
||||||
* Copyright 2015 SmartThings
|
===============================================================================
|
||||||
|
* Copyright 2016 SmartThings
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||||
* in compliance with the License. You may obtain a copy of the License at:
|
* use this file except 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: SmartPower Outlet DTH File
|
||||||
*
|
*
|
||||||
* SmartPower Outlet (CentraLite)
|
* Filename: SmartPower-Outlet.src/SmartPower-Outlet.groovy
|
||||||
*
|
*
|
||||||
* Author: SmartThings
|
* Change History:
|
||||||
* Date: 2015-08-23
|
* 1. 20160117 TW - Update/Edit to support i18n translations
|
||||||
|
===============================================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
metadata {
|
metadata {
|
||||||
// Automatically generated. Make future change here.
|
// Automatically generated. Make future change here.
|
||||||
definition (name: "SmartPower Outlet", namespace: "smartthings", author: "SmartThings") {
|
definition (name: "SmartPower Outlet", namespace: "smartthings", author: "SmartThings") {
|
||||||
@@ -91,22 +99,24 @@ def parse(String description) {
|
|||||||
finalResult = getPowerDescription(zigbee.parseDescriptionAsMap(description))
|
finalResult = getPowerDescription(zigbee.parseDescriptionAsMap(description))
|
||||||
|
|
||||||
if (finalResult) {
|
if (finalResult) {
|
||||||
log.info finalResult
|
log.info "final result = $finalResult"
|
||||||
if (finalResult.type == "update") {
|
if (finalResult.type == "update") {
|
||||||
log.info "$device updates: ${finalResult.value}"
|
log.info "$device updates: ${finalResult.value}"
|
||||||
}
|
}
|
||||||
else if (finalResult.type == "power") {
|
else if (finalResult.type == "power") {
|
||||||
def powerValue = (finalResult.value as Integer)/10
|
def value = (finalResult.value as Integer)/10
|
||||||
sendEvent(name: "power", value: powerValue)
|
createEvent(name: "power", value: value, descriptionText: '{{ device.displayName }} power is {{ value }} Watts', translatable: true )
|
||||||
/*
|
/*
|
||||||
Dividing by 10 as the Divisor is 10000 and unit is kW for the device. AttrId: 0302 and 0300. Simplifying to 10
|
Dividing by 10 as the Divisor is 10000 and unit is kW for the device. AttrId: 0302 and 0300. Simplifying to 10
|
||||||
|
|
||||||
power level is an integer. The exact power level with correct units needs to be handled in the device type
|
power level is an integer. The exact power level with correct units needs to be handled in the device type
|
||||||
to account for the different Divisor value (AttrId: 0302) and POWER Unit (AttrId: 0300). CLUSTER for simple metering is 0702
|
to account for the different Divisor value (AttrId: 0302) and POWER Unit (AttrId: 0300). CLUSTER for simple metering is 0702
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sendEvent(name: finalResult.type, value: finalResult.value)
|
if ( finalResult.value == "on" )
|
||||||
|
createEvent(name: finalResult.type, value: finalResult.value, descriptionText: '{{ device.displayName }} is On', translatable: true)
|
||||||
|
else
|
||||||
|
createEvent(name: finalResult.type, value: finalResult.value, descriptionText: '{{ device.displayName }} is Off', translatable: true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -167,4 +177,4 @@ def getPowerDescription(descMap) {
|
|||||||
else {
|
else {
|
||||||
return [:]
|
return [:]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user