Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wiz] Correct units for RSSI #17867

Merged
merged 2 commits into from
Dec 11, 2024
Merged

[wiz] Correct units for RSSI #17867

merged 2 commits into from
Dec 11, 2024

Conversation

ccutrer
Copy link
Contributor

@ccutrer ccutrer commented Dec 8, 2024

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

See discussion in #17826

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

See discussion in openhab#17826

Signed-off-by: Cody Cutrer <cody@cutrer.us>
@jlaur
Copy link
Contributor

jlaur commented Dec 8, 2024

Thanks! Can you please also provide update instructions for fixing the channel? Otherwise LGTM.

@lolodomo
Copy link
Contributor

lolodomo commented Dec 8, 2024

This is the case where only item type is changed. It cannot be handle through upgrade instructions. But I remember @lsiepel made rests few weeks ago and if I correctly remember it was not necessary. @lsiepel ?

@jlaur
Copy link
Contributor

jlaur commented Dec 8, 2024

This is the case where only item type is changed. It cannot be handle through upgrade instructions. But I remember @lsiepel made rests few weeks ago and if I correctly remember it was not necessary. @lsiepel ?

I think an update instruction is needed and will work, see #17845. Please correct me if I'm wrong, @andrewfg.

@andrewfg
Copy link
Contributor

andrewfg commented Dec 8, 2024

Do you need upgrade instructions? The original binding was only released a few days ago, so the only users so far will be snapshot users.

@jlaur
Copy link
Contributor

jlaur commented Dec 8, 2024

Do you need upgrade instructions? The original binding was only released a few days ago, so the only users so far will be snapshot users.

Sorry for being unclear, I meant to ask you for confirmation that it will work.

It is needed, because otherwise snapshot and milestone 5 users will need to recreate their Things.

@jlaur jlaur added bug An unexpected problem or unintended behavior of an add-on regression Regression that happened during the development of a release. Not shown on final release notes. labels Dec 8, 2024
@andrewfg
Copy link
Contributor

andrewfg commented Dec 8, 2024

^
Insofar as #17845 did work, then this would work here too. (But TBH although it changes the channel type on already created things, I don't know it the upgrade process does actually change the parameters on already created items that are linked to those channels. I think it should do that, but I honestly don't know if it really does so. But in any case that is a discussion for OH and not here..

@andrewfg
Copy link
Contributor

andrewfg commented Dec 8, 2024

Probably you need something like the following (not checked)..

/update/instructions.xml

<?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>

and for each thing-type.xml

  <thing-type uid="color-bulb">
    ...
    <properties>
      <property name="thingTypeVersion">1</property>
    </properties>
    ...

  <thing-type uid="tunable-bulb">
    ...
    <properties>
      <property name="thingTypeVersion">1</property>
    </properties>
    ...

  <thing-type uid="dimmable-bulb">
    ...
    <properties>
      <property name="thingTypeVersion">1</property>
    </properties>
    ...

  <thing-type uid="plug">
    ...
    <properties>
      <property name="thingTypeVersion">1</property>
    </properties>
    ...

  <thing-type uid="fan">
    ...
    <properties>
      <property name="thingTypeVersion">1</property>
    </properties>
    ...

  <thing-type uid="fan-with-dimmable-bulb">
    <properties>
      <property name="thingTypeVersion">1</property>
    </properties>

@lsiepel
Copy link
Contributor

lsiepel commented Dec 9, 2024

Bit late to the discussion, but yes upgrade instructions are needed, a simple update statement is enough exactly as what @andrewfg suggests.
For reference: #17737 (comment)

Signed-off-by: Cody Cutrer <cody@cutrer.us>
Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jlaur jlaur merged commit 8ea703e into openhab:main Dec 11, 2024
5 checks passed
@jlaur jlaur added this to the 4.3 milestone Dec 11, 2024
@ccutrer ccutrer deleted the wiz-rssi-dbm branch December 11, 2024 14:14
matchews pushed a commit to matchews/openhab-addons that referenced this pull request Dec 16, 2024
Number:Power of dBm, instead of Number:Dimensionless of dB.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on regression Regression that happened during the development of a release. Not shown on final release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants