Skip to content

Commit

Permalink
PR review: many fix
Browse files Browse the repository at this point in the history
Signed-off-by: Jordan Martin <jo69270@gmail.com>
  • Loading branch information
JordanMartin committed Dec 18, 2023
1 parent 4f08804 commit 1678465
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 63 deletions.
34 changes: 17 additions & 17 deletions bundles/org.openhab.binding.thekeys/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,27 @@ The following configuration options are available:

| Name | Type | Description | Default | Required | Advanced |
|-----------------|---------|-----------------------------------------|---------|----------|----------|
| host | text | Host or IP address of the device | N/A | yes | no |
| host | text | Host or IP address of the gateway | N/A | yes | no |
| code | text | The gateway access code | N/A | yes | no |
| refreshInterval | integer | Interval the device is polled in sec | 5 | no | no |
| apiTimeout | integer | API timeout in seconds for each request | 30 | no | yes |

### Discovery

The bridge can't be discovered automatically.
The `host` must be provided.
The `host` parameter must be provided.
You can find it from the ios/android app : Home Page > Accessories > TK Gateway > Configure > IP

### Supported Channels

The gateway have no channels.
The gateway has no channels.
It only exposes one property `firmwareVersion` containing the firmware version.

## Supported Things

### `smartlock` Thing Configuration

This thing allows to control the smartlock and check its state
This thing allows to control the smartlock and check its state.

| Name | Type | Description | Default | Required | Advanced |
|-----------------|---------|---------------------------------------|---------|----------|----------|
Expand All @@ -60,16 +60,16 @@ Hit the "scan" button when you add the thing through the UI

### Supported Channels

| Channel | Type | Read/Write | Description |
|-----------------|--------|------------|------------------------------------------------|
| status | String | R | Status of the smartlock |
| batteryLevel | Number | R | Current battery level |
| lowBattery | Switch | R | Low battery warning |
| rssi | Number | R | Bluetooth Signal strength with the gateway |
| position | Number | R | Position of the lock |
| syncInProgress | Number | R | Indicates the pending update of the lock state |
| lastSync | String | R | Date of the last success sync with the lock |
| lock | Switch | RW | Switch to open and close the lock |
| Channel | Type | Read/Write | Description |
|-----------------|--------------|------------|------------------------------------------------|
| status | String | R | Status of the smartlock |
| batteryLevel | Number:Power | R | Current battery level |
| lowBattery | Switch | R | Low battery warning |
| rssi | Number | R | Bluetooth signal strength with the gateway |
| position | Number | R | Position of the lock |
| syncInProgress | Switch | R | Indicates the pending update of the lock state |
| lastSync | DateTime | R | Date of the last success sync with the lock |
| lock | Switch | RW | Switch to open and close the lock |

## Full Example

Expand All @@ -78,8 +78,8 @@ A manual setup through files could look like this:
### things/thekeys.things

```
Bridge thekeys:gateway:tk-gateway [ host="192.168.1.50", code="secretcode", refreshInterval="5", apiTimeout="30" ] {
Thing smartlock tk-smartlock [ lockId="1234" ]
Bridge thekeys:gateway:tk-gateway [ host="192.168.1.50", code="secretcode", refreshInterval=5, apiTimeout=30 ] {
Thing smartlock tk-smartlock [ lockId=1234 ]
}
```

Expand All @@ -97,5 +97,5 @@ Number Smartlock_Bluetooth_rssi "Bluetooth rssi" <Qu
Number Smartlock_Smartlock_position "Smartlock position" (Smartlock) ["Point"] { channel="thekeys:smartlock:tk-gateway:1234:position" }
Switch Smartlock_Synchronization_in_progress "Synchronization in progress" (Smartlock) ["Point"] { channel="thekeys:smartlock:tk-gateway:1234:syncInProgress" }
DateTime Smartlock_Last_sync "Last sync" (Smartlock) ["Point"] { channel="thekeys:smartlock:tk-gateway:1234:lastSync" }
Switch Smartlock_Lock "Lock" <Door> (Smartlock) ["Point"] { channel="thekeys:smartlock:tk-gateway:1234:lock" }
Switch Smartlock_Lock "Lock" <Lock> (Smartlock) ["Point"] { channel="thekeys:smartlock:tk-gateway:1234:lock" }
```
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<type>binding</type>
<name>TheKeys Binding</name>
<description>TheKeys Binding to control a smart lock through the bluetooth gateway</description>
<description>TheKeys Binding controls a smartlock through the bluetooth gateway</description>
<connection>local</connection>

</addon:addon>
Original file line number Diff line number Diff line change
@@ -1,43 +1,41 @@
# add-on

addon.thekeys.name = TheKeys Binding
addon.thekeys.description = TheKeys Binding to control a smart lock through the bluetooth gateway
addon.thekeys.description = TheKeys Binding controls a smartlock through the bluetooth gateway

# thing types

thing-type.thekeys.gateway.label = TheKeys Gateway
thing-type.thekeys.gateway.description = Gateway controlling a smartlock
thing-type.thekeys.smartlock.label = TheKeys Smartlock
thing-type.thekeys.smartlock.description = A smartlock controlling by the gateway
thing-type.thekeys.smartlock.description = A smartlock controlled by the gateway

# thing types config

thing-type.config.thekeys.gateway.apiTimeout.label = API timeout
thing-type.config.thekeys.gateway.apiTimeout.description = The api timeout in seconds for each request
thing-type.config.thekeys.gateway.apiTimeout.label = API Timeout
thing-type.config.thekeys.gateway.apiTimeout.description = The api timeout for each request
thing-type.config.thekeys.gateway.code.label = Code
thing-type.config.thekeys.gateway.code.description = Code to access the gateway
thing-type.config.thekeys.gateway.host.label = Host
thing-type.config.thekeys.gateway.host.description = Host or IP address of the gateway
thing-type.config.thekeys.gateway.refreshInterval.label = Refresh Interval
thing-type.config.thekeys.gateway.refreshInterval.description = The refresh interval in seconds which is used to poll the gateway
thing-type.config.thekeys.smartlock.lockId.label = Lock id
thing-type.config.thekeys.smartlock.lockId.label = Lock ID
thing-type.config.thekeys.smartlock.lockId.description = Identifier of the smartlock

# channel types

channel-type.thekeys.lastSync.label = Last sync
channel-type.thekeys.lastSync.label = Last Sync
channel-type.thekeys.lastSync.description = Last success synchronization with the smartlock
channel-type.thekeys.lock_status.label = Lock status
channel-type.thekeys.lock_status.label = Lock Status
channel-type.thekeys.lock_status.description = Status of the smartlock
channel-type.thekeys.position.label = Smartlock position
channel-type.thekeys.position.description = Position of the smartlock
channel-type.thekeys.rssi.label = Bluetooth rssi
channel-type.thekeys.position.label = Smartlock Position
channel-type.thekeys.position.description = Rotation position of the smartlock
channel-type.thekeys.rssi.label = Bluetooth RSSI
channel-type.thekeys.rssi.description = Bluetooth Received Signal Strength Indication
channel-type.thekeys.smartlockLock.label = Lock
channel-type.thekeys.smartlockLock.description = Use this channel with a Switch Item to open and close the smartlock
channel-type.thekeys.smartlockLock.state.option.ON = Unlock
channel-type.thekeys.smartlockLock.state.option.OFF = Lock
channel-type.thekeys.syncInProgress.label = Synchronization in progress
channel-type.thekeys.syncInProgress.label = Synchronization In Progress
channel-type.thekeys.syncInProgress.description = Indicate synchronization with the gateway

# discovery result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,14 @@ channel-type.thekeys.rssi.label = RSSI bluetooth
channel-type.thekeys.rssi.description = Force du signal reçu Bluetooth
channel-type.thekeys.smartlockLock.label = Verrouiller
channel-type.thekeys.smartlockLock.description = Utilisez ce canal avec un élément switch pour ouvrir et fermer la serrure
channel-type.thekeys.smartlockLock.state.option.ON = Déverrouiller
channel-type.thekeys.smartlockLock.state.option.OFF = Verrouiller
channel-type.thekeys.syncInProgress.label = Synchronisation en cours
channel-type.thekeys.syncInProgress.description = Indique une synchronisation en cours avec la passerelle

# discovery result

discovery.thekeys.smartlock.label = Serrure connectée

# Status message
# status message

message.status.wait-data-from-gateway = En attente de données depuis la passerelle
message.status.lock-no-found = La serrure configurée n'a pas été trouvée sur la passerelle
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@
<label>TheKeys Gateway</label>
<description>Gateway controlling a smartlock</description>

<properties>
<property name="firmwareVersion"/>
</properties>

<config-description>
<parameter name="host" type="text" required="true">
<context>network-address </context>
<context>network-address</context>
<label>Host</label>
<description>Host or IP address of the gateway</description>
</parameter>
Expand All @@ -23,13 +19,13 @@
<label>Code</label>
<description>Code to access the gateway</description>
</parameter>
<parameter name="refreshInterval" type="integer" min="1" unit="s" required="true">
<parameter name="refreshInterval" type="integer" min="1" unit="s">
<label>Refresh Interval</label>
<description>The refresh interval in seconds which is used to poll the gateway</description>
<default>5</default>
</parameter>
<parameter name="apiTimeout" type="integer" min="1" unit="s" required="true">
<label>API timeout</label>
<parameter name="apiTimeout" type="integer" min="1" unit="s">
<label>API Timeout</label>
<description>The api timeout for each request</description>
<default>30</default>
<advanced>true</advanced>
Expand All @@ -43,7 +39,7 @@
</supported-bridge-type-refs>

<label>TheKeys Smartlock</label>
<description>A smartlock controlling by the gateway</description>
<description>A smartlock controlled by the gateway</description>

<channels>
<channel id="status" typeId="lock_status"/>
Expand All @@ -56,50 +52,46 @@
<channel id="lock" typeId="smartlockLock"/>
</channels>

<properties>
<property name="firmwareVersion"/>
</properties>

<config-description>
<parameter name="lockId" type="integer" required="true">
<label>Lock id</label>
<label>Lock ID</label>
<description>Identifier of the smartlock</description>
</parameter>
</config-description>
</thing-type>

<channel-type id="lock_status">
<item-type>String</item-type>
<label>Lock status</label>
<label>Lock Status</label>
<description>Status of the smartlock</description>
<state readOnly="true"/>
</channel-type>

<channel-type id="rssi">
<item-type>Number:Power</item-type>
<label>Bluetooth rssi</label>
<label>Bluetooth RSSI</label>
<description>Bluetooth Received Signal Strength Indication</description>
<category>QualityOfService</category>
<state readOnly="true" pattern="%d %unit%"/>
</channel-type>

<channel-type id="position">
<item-type>Number</item-type>
<label>Smartlock position</label>
<description>Position of the smartlock</description>
<state readOnly="true"/>
<label>Smartlock Position</label>
<description>Rotation position of the smartlock</description>
<state readOnly="true" pattern="%d"/>
</channel-type>

<channel-type id="lastSync">
<item-type>DateTime</item-type>
<label>Last sync</label>
<label>Last Sync</label>
<description>Last success synchronization with the smartlock</description>
<state readOnly="true"/>
<state readOnly="true" pattern="%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS"/>
</channel-type>

<channel-type id="syncInProgress">
<item-type>Switch</item-type>
<label>Synchronization in progress</label>
<label>Synchronization In Progress</label>
<description>Indicate synchronization with the gateway</description>
<state readOnly="true"/>
</channel-type>
Expand All @@ -108,13 +100,7 @@
<item-type>Switch</item-type>
<label>Lock</label>
<description>Use this channel with a Switch Item to open and close the smartlock</description>
<category>Door</category>
<state>
<options>
<option value="ON">Unlock</option>
<option value="OFF">Lock</option>
</options>
</state>
<category>Lock</category>
</channel-type>

</thing:thing-descriptions>

0 comments on commit 1678465

Please sign in to comment.