[wemo] Add dimensions for power/energy channel types for Insight Switch. (#11208)

* Add dimensions for power/energy channel types for Insight Switch.

Fixes #11207

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This commit is contained in:
jlaur
2021-09-08 20:36:03 +02:00
committed by GitHub
parent 5ae581f4e1
commit 8f836a08ea
4 changed files with 83 additions and 76 deletions

View File

@@ -25,6 +25,8 @@ import org.openhab.binding.wemo.internal.handler.WemoHandler;
import org.openhab.binding.wemo.internal.http.WemoHttpCall;
import org.openhab.core.library.types.DecimalType;
import org.openhab.core.library.types.OnOffType;
import org.openhab.core.library.types.QuantityType;
import org.openhab.core.library.unit.Units;
import org.openhab.core.thing.Thing;
import org.openhab.core.thing.ThingStatus;
import org.openhab.core.thing.ThingStatusDetail;
@@ -122,7 +124,7 @@ public class WemoHandlerTest {
@Test
public void assertThatChannelAVERAGEPOWERIsUpdatedOnReceivedValue() {
insightParams.avgPower = POWER_PARAM;
State expectedStateType = new DecimalType(POWER_PARAM);
State expectedStateType = new QuantityType<>(POWER_PARAM, Units.WATT);
String expectedChannel = CHANNEL_AVERAGEPOWER;
testOnValueReceived(expectedChannel, expectedStateType, insightParams.toString());