if (endpoint == null){
logger.error("Endpoint {} not found on node {}. Cannot set command classes.", endpointId, this.getNode().getNodeId());
continue;
}
Basic basic = this.getNode().getDeviceClass().getBasicDeviceClass();
Generic generic = Generic.getGeneric(genericDeviceClass);
if (generic == null) {
logger.error(String.format("NODE %d: Endpoint %d has invalid device class. generic = 0x%02x, specific = 0x%02x.",
this.getNode().getNodeId(), endpoint, genericDeviceClass, specificDeviceClass));
continue;
}
Specific specific = Specific.getSpecific(generic, specificDeviceClass);
if (specific == null) {
logger.error(String.format("NODE %d: Endpoint %d has invalid device class. generic = 0x%02x, specific = 0x%02x.",
this.getNode().getNodeId(), endpoint, genericDeviceClass, specificDeviceClass));
continue;
}
logger.debug("NODE {}: Endpoint Id = {}", this.getNode().getNodeId(), endpointId);
logger.debug("NODE {}: Endpoints is dynamic = {}", this.getNode().getNodeId(), dynamic ? "true" : false);
logger.debug(String.format("NODE %d: Basic = %s 0x%02x", this.getNode().getNodeId(), basic.getLabel(), basic.getKey()));
logger.debug(String.format("NODE %d: Generic = %s 0x%02x", this.getNode().getNodeId(), generic.getLabel(), generic.getKey()));
logger.debug(String.format("NODE %d: Specific = %s 0x%02x", this.getNode().getNodeId(), specific.getLabel(), specific.getKey()));
ZWaveDeviceClass deviceClass = endpoint.getDeviceClass();
deviceClass.setBasicDeviceClass(basic);