/** * Updates a AudioZone's source text fields when a AudioSource changes * * @param as the audio source that has been updated */ private void updateAudioZoneText(AudioSource as) { for (OmniLinkBindingProvider provider : providers) { for (String itemName : provider.getItemNames()) { OmniLinkBindingConfig config = provider.getOmniLinkBindingConfig(itemName); if (config != null) { switch (config.getObjectType()) { case AUDIOZONE_TEXT: case AUDIOZONE_TEXT_FIELD1: case AUDIOZONE_TEXT_FIELD2: case AUDIOZONE_TEXT_FIELD3: { AudioZone az = (AudioZone) config.getDevice(); az.setAudioSource(audioSourceMap); if (az.getProperties().getSource() == as.getProperties().getNumber()) { az.updateItem(provider.getItem(itemName), config, eventPublisher); } } break; default: break; } } } } }
/** * Update any items linked to a Omni device. * * @param device */ protected void updateItemsForDevice(OmnilinkDevice device) { for (OmniLinkBindingProvider provider : providers) { for (String itemName : provider.getItemNames()) { OmniLinkBindingConfig bindingConfig = provider.getOmniLinkBindingConfig(itemName); OmnilinkDevice itemDevice = bindingConfig.getDevice(); Item item = provider.getItem(itemName); if (itemDevice != null && itemDevice == device) { device.updateItem(item, bindingConfig, eventPublisher); } } } }