@Test public void testHKV64Support() { ThingImpl thing = new ThingImpl(THING_TYPE_TECHEM_HKV64, "00000"); ThingHandler handler = handlerFactory.createHandler(thing); Assertions.assertThat(handler).isNotNull(); }
@Override protected ThingHandler createHandler(Thing thing) { ThingTypeUID thingTypeUID = thing.getThingTypeUID(); if (thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HKV45) || thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HKV61) || thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HKV64) || thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HKV69) || thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HKV94)) { logger.debug("Creating handler for TechemDevice device {}", thing.getUID().getId()); return new TechemMeterHandler<>(thing, TechemHeatCostAllocator.class, techemFrameDecoder); } else if (thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_WARM_WATER_METER) || thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_COLD_WATER_METER)) { logger.debug("Creating handler for TechemDevice device {}", thing.getUID().getId()); return new TechemMeterHandler<>(thing, TechemWaterMeter.class, techemFrameDecoder); } else if (thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_SD76)) { logger.debug("Creating handler for Techem Smoke Detector device {}", thing.getUID().getId()); return new TechemMeterHandler<>(thing, TechemSmokeDetector.class, techemFrameDecoder); } else if (thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HEAT_METER)) { logger.debug("Creating handler for TechemDevice device {}", thing.getUID().getId()); return new TechemMeterHandler<>(thing, TechemHeatMeter.class, techemFrameDecoder); } logger.warn("Unsupported thing type {}. TechemHandlerFactory can not handle {}", thingTypeUID, thing.getUID()); return null; }
TechemHandlerFactory extends BaseThingHandlerFactory { @Override protected ThingHandler createHandler(Thing thing) { ThingTypeUID thingTypeUID = thing.getThingTypeUID(); if (thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HKV45) || thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HKV61) || thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HKV64) || thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HKV69) || thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HKV94)) { logger.debug("Creating handler for TechemDevice device {}", thing.getUID().getId()); return new TechemMeterHandler<>(thing, TechemHeatCostAllocator.class, techemFrameDecoder); } else if (thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_WARM_WATER_METER) || thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_COLD_WATER_METER)) { logger.debug("Creating handler for TechemDevice device {}", thing.getUID().getId()); return new TechemMeterHandler<>(thing, TechemWaterMeter.class, techemFrameDecoder); } else if (thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_SD76)) { logger.debug("Creating handler for Techem Smoke Detector device {}", thing.getUID().getId()); return new TechemMeterHandler<>(thing, TechemSmokeDetector.class, techemFrameDecoder); } else if (thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HEAT_METER)) { logger.debug("Creating handler for TechemDevice device {}", thing.getUID().getId()); return new TechemMeterHandler<>(thing, TechemHeatMeter.class, techemFrameDecoder); } logger.warn("Unsupported thing type {}. TechemHandlerFactory can not handle {}", thingTypeUID, thing.getUID()); return null; } }
TechemHandlerFactory extends BaseThingHandlerFactory { @Override protected ThingHandler createHandler(Thing thing) { ThingTypeUID thingTypeUID = thing.getThingTypeUID(); if (thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HKV45) || thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HKV61) || thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HKV64) || thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HKV69) || thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HKV94)) { logger.debug("Creating handler for TechemDevice device {}", thing.getUID().getId()); return new TechemMeterHandler<>(thing, TechemHeatCostAllocator.class, techemFrameDecoder); } else if (thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_WARM_WATER_METER) || thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_COLD_WATER_METER)) { logger.debug("Creating handler for TechemDevice device {}", thing.getUID().getId()); return new TechemMeterHandler<>(thing, TechemWaterMeter.class, techemFrameDecoder); } else if (thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_SD76)) { logger.debug("Creating handler for Techem Smoke Detector device {}", thing.getUID().getId()); return new TechemMeterHandler<>(thing, TechemSmokeDetector.class, techemFrameDecoder); } else if (thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HEAT_METER)) { logger.debug("Creating handler for TechemDevice device {}", thing.getUID().getId()); return new TechemMeterHandler<>(thing, TechemHeatMeter.class, techemFrameDecoder); } logger.warn("Unsupported thing type {}. TechemHandlerFactory can not handle {}", thingTypeUID, thing.getUID()); return null; } TechemHandlerFactory(); }
TechemHandlerFactory extends BaseThingHandlerFactory { @Override protected ThingHandler createHandler(Thing thing) { ThingTypeUID thingTypeUID = thing.getThingTypeUID(); if (thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HKV45) || thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HKV61) || thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HKV64) || thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HKV69) || thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HKV94)) { logger.debug("Creating handler for TechemDevice device {}", thing.getUID().getId()); return new TechemMeterHandler<>(thing, TechemHeatCostAllocator.class, techemFrameDecoder); } else if (thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_WARM_WATER_METER) || thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_COLD_WATER_METER)) { logger.debug("Creating handler for TechemDevice device {}", thing.getUID().getId()); return new TechemMeterHandler<>(thing, TechemWaterMeter.class, techemFrameDecoder); } else if (thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_SD76)) { logger.debug("Creating handler for Techem Smoke Detector device {}", thing.getUID().getId()); return new TechemMeterHandler<>(thing, TechemSmokeDetector.class, techemFrameDecoder); } else if (thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HEAT_METER)) { logger.debug("Creating handler for TechemDevice device {}", thing.getUID().getId()); return new TechemMeterHandler<>(thing, TechemHeatMeter.class, techemFrameDecoder); } logger.warn("Unsupported thing type {}. TechemHandlerFactory can not handle {}", thingTypeUID, thing.getUID()); return null; } TechemHandlerFactory(); @Override boolean supportsThingType(ThingTypeUID thingTypeUID); @Reference void setTechemFrameDecoder(TechemFrameDecoder<TechemDevice> decoder); void unsetTechemFrameDecoder(TechemFrameDecoder<TechemDevice> decoder); }
TechemHandlerFactory extends BaseThingHandlerFactory { @Override protected ThingHandler createHandler(Thing thing) { ThingTypeUID thingTypeUID = thing.getThingTypeUID(); if (thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HKV45) || thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HKV61) || thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HKV64) || thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HKV69) || thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HKV94)) { logger.debug("Creating handler for TechemDevice device {}", thing.getUID().getId()); return new TechemMeterHandler<>(thing, TechemHeatCostAllocator.class, techemFrameDecoder); } else if (thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_WARM_WATER_METER) || thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_COLD_WATER_METER)) { logger.debug("Creating handler for TechemDevice device {}", thing.getUID().getId()); return new TechemMeterHandler<>(thing, TechemWaterMeter.class, techemFrameDecoder); } else if (thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_SD76)) { logger.debug("Creating handler for Techem Smoke Detector device {}", thing.getUID().getId()); return new TechemMeterHandler<>(thing, TechemSmokeDetector.class, techemFrameDecoder); } else if (thingTypeUID.equals(TechemBindingConstants.THING_TYPE_TECHEM_HEAT_METER)) { logger.debug("Creating handler for TechemDevice device {}", thing.getUID().getId()); return new TechemMeterHandler<>(thing, TechemHeatMeter.class, techemFrameDecoder); } logger.warn("Unsupported thing type {}. TechemHandlerFactory can not handle {}", thingTypeUID, thing.getUID()); return null; } TechemHandlerFactory(); @Override boolean supportsThingType(ThingTypeUID thingTypeUID); @Reference void setTechemFrameDecoder(TechemFrameDecoder<TechemDevice> decoder); void unsetTechemFrameDecoder(TechemFrameDecoder<TechemDevice> decoder);  }