Skip to content

Commit

Permalink
[wiz] Correct units for RSSI (openhab#17867)
Browse files Browse the repository at this point in the history
Number:Power of dBm, instead of Number:Dimensionless of dB.

Signed-off-by: Cody Cutrer <[email protected]>
  • Loading branch information
ccutrer authored and matchews committed Dec 16, 2024
1 parent d84b8be commit 785c930
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ private synchronized void updateStatesFromParams(final WizSyncState receivedPara
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));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand All @@ -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>

Expand All @@ -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>

Expand All @@ -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>

Expand All @@ -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>

Expand All @@ -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>

Expand Down Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
@@ -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>

0 comments on commit 785c930

Please sign in to comment.