[wiz] Correct units for RSSI (#17867)

Number:Power of dBm, instead of Number:Dimensionless of dB.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
This commit is contained in:
Cody Cutrer 2024-12-11 00:12:06 -07:00 committed by GitHub
parent 91d6b62dd0
commit 8ea703ecd3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 74 additions and 2 deletions

View File

@ -592,7 +592,7 @@ public class WizHandler extends BaseThingHandler {
strength = 4;
}
updateDeviceState(CHANNEL_SIGNAL_STRENGTH, new DecimalType(strength));
updateDeviceState(CHANNEL_RSSI, new QuantityType<>(receivedParam.rssi, Units.DECIBEL));
updateDeviceState(CHANNEL_RSSI, new QuantityType<>(receivedParam.rssi, Units.DECIBEL_MILLIWATTS));
}
}

View File

@ -17,6 +17,9 @@
<channel id="last-update" typeId="last-update"/>
<channel id="rssi" typeId="rssi"/>
</channels>
<properties>
<property name="thingTypeVersion">1</property>
</properties>
<config-description-ref uri="thing-type:wiz:device"/>
</thing-type>
@ -34,6 +37,9 @@
<channel id="last-update" typeId="last-update"/>
<channel id="rssi" typeId="rssi"/>
</channels>
<properties>
<property name="thingTypeVersion">1</property>
</properties>
<config-description-ref uri="thing-type:wiz:device"/>
</thing-type>
@ -49,6 +55,9 @@
<channel id="last-update" typeId="last-update"/>
<channel id="rssi" typeId="rssi"/>
</channels>
<properties>
<property name="thingTypeVersion">1</property>
</properties>
<config-description-ref uri="thing-type:wiz:device"/>
</thing-type>
@ -62,6 +71,9 @@
<channel id="last-update" typeId="last-update"/>
<channel id="rssi" typeId="rssi"/>
</channels>
<properties>
<property name="thingTypeVersion">1</property>
</properties>
<config-description-ref uri="thing-type:wiz:device"/>
</thing-type>
@ -78,6 +90,9 @@
<channel id="last-update" typeId="last-update"/>
<channel id="rssi" typeId="rssi"/>
</channels>
<properties>
<property name="thingTypeVersion">1</property>
</properties>
<config-description-ref uri="thing-type:wiz:device"/>
</thing-type>
@ -90,6 +105,9 @@
<channel-group id="light" typeId="dimmable-light"/>
<channel-group id="fan" typeId="fan-group"/>
</channel-groups>
<properties>
<property name="thingTypeVersion">1</property>
</properties>
<config-description-ref uri="thing-type:wiz:device"/>
</thing-type>
@ -185,7 +203,7 @@
</channel-type>
<channel-type id="rssi" advanced="true">
<item-type unitHint="dB">Number:Dimensionless</item-type>
<item-type unitHint="dBm">Number:Power</item-type>
<label>RSSI</label>
<description>WiFi Received Signal Strength Indicator</description>
<category>QualityOfService</category>

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<update:update-descriptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:update="https://openhab.org/schemas/update-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/update-description/v1.0.0 https://openhab.org/schemas/update-description-1.0.0.xsd">
<thing-type uid="wiz:color-bulb">
<instruction-set targetVersion="1">
<update-channel id="rssi">
<type>wiz:rssi</type>
</update-channel>
</instruction-set>
</thing-type>
<thing-type uid="wiz:tunable-bulb">
<instruction-set targetVersion="1">
<update-channel id="rssi">
<type>wiz:rssi</type>
</update-channel>
</instruction-set>
</thing-type>
<thing-type uid="wiz:dimmable-bulb">
<instruction-set targetVersion="1">
<update-channel id="rssi">
<type>wiz:rssi</type>
</update-channel>
</instruction-set>
</thing-type>
<thing-type uid="wiz:plug">
<instruction-set targetVersion="1">
<update-channel id="rssi">
<type>wiz:rssi</type>
</update-channel>
</instruction-set>
</thing-type>
<thing-type uid="wiz:fan">
<instruction-set targetVersion="1">
<update-channel id="rssi">
<type>wiz:rssi</type>
</update-channel>
</instruction-set>
</thing-type>
<thing-type uid="wiz:fan-with-dimmable-bulb">
<instruction-set targetVersion="1">
<update-channel id="rssi">
<type>wiz:rssi</type>
</update-channel>
</instruction-set>
</thing-type>
</update:update-descriptions>