Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix CommunicationManager erroring on unusual item<->channel link (ope…
…nhab#3326) Some bindings that dynamically create channels (mqtt.homie) might create a channel that declares itself as Number:Dimensionless because the end-device metadata has a unit of "%". But a savvy user might want to link that to a Dimmer or Rollershutter item depending on what the device actually is. This actually works just fine since QuantityType (with unit PERCENT) and PercentType implicitly convert between each other. Except this odd compatibility code in CommunicationManager that tries to assist bindings that _aren't_ QuantityType compatible. It assumes if the channel's item type is a dimensioned item, that the actual Item is a NumberItem, and casts without checking. All this does is checks for that case to avoid a ClassCastException. Signed-off-by: Cody Cutrer <cody@cutrer.us>
- Loading branch information