From 24dcc2b3dc8edec510150fa7599bf5576e570efe Mon Sep 17 00:00:00 2001 From: Stephan Knull Date: Fri, 29 Dec 2023 13:37:58 +0100 Subject: [PATCH] Move all device models into the core module. That one needs anyway to know about these for hybrid approaches. And over time inconsistencies regarding where stuff lives came in. --- .../model/{preferences => dmx}/Dmx.kt | 4 +- .../model/{preferences => dmx}/DmxDevice.kt | 2 +- .../klanglicht/model/hybrid}/HybridScene.kt | 7 +- .../model/lightmanager}/json/Actuator.kt | 2 +- .../lightmanager}/json/ActuatorProperties.kt | 2 +- .../model/lightmanager}/json/Device.kt | 2 +- .../model/lightmanager}/json/Marker.kt | 2 +- .../model/lightmanager}/json/Project.kt | 2 +- .../model/lightmanager}/json/Scene.kt | 2 +- .../lightmanager}/json/SceneProperties.kt | 2 +- .../model/lightmanager}/json/Settings.kt | 2 +- .../model/lightmanager}/xml/Actuator.kt | 2 +- .../model/lightmanager}/xml/Command.kt | 2 +- .../model/lightmanager}/xml/Lightman.kt | 2 +- .../model/lightmanager}/xml/Scene.kt | 2 +- .../model/lightmanager}/xml/Zone.kt | 2 +- .../model/preferences/Preferences.kt | 2 + .../model/preferences/ShellyDevice.kt | 10 - .../{preferences => shelly}/ColorState.kt | 2 +- .../klanglicht/model/shelly/ShellyColor.kt | 43 ++++ .../klanglicht/model/shelly/ShellyDevice.kt | 63 ++++++ .../model}/shelly/client/ShellyClient.kt | 13 +- .../model/shelly/status/ActionStats.kt | 6 + .../klanglicht/model/shelly}/status/Cloud.kt | 2 +- .../shelly/status/ExternalTemperature.kt | 3 + .../model/shelly/status/Humidity.kt | 3 + .../klanglicht/model/shelly}/status/Input.kt | 2 +- .../klanglicht/model/shelly}/status/Light.kt | 11 +- .../klanglicht/model/shelly}/status/Meter.kt | 2 +- .../klanglicht/model/shelly/status/Mqtt.kt | 6 + .../klanglicht/model/shelly}/status/Relay.kt | 2 +- .../klanglicht/model/shelly/status/Sensor.kt | 3 + .../klanglicht/model/shelly}/status/Status.kt | 2 +- .../model/shelly}/status/Temperature.kt | 2 +- .../klanglicht/model/shelly}/status/Update.kt | 2 +- .../model/shelly}/status/WifiState.kt | 2 +- .../model/yamaha}/AbstractMenuProvider.kt | 4 +- .../kotlin/klanglicht/model/yamaha}/Cmd.kt | 4 +- .../klanglicht/model/yamaha}/CmdList.kt | 6 +- .../kotlin/klanglicht/model/yamaha}/Define.kt | 4 +- .../kotlin/klanglicht/model/yamaha}/Direct.kt | 4 +- .../kotlin/klanglicht/model/yamaha}/F.kt | 4 +- .../kotlin/klanglicht/model/yamaha}/FKey.kt | 12 +- .../kotlin/klanglicht/model/yamaha}/Get.kt | 12 +- .../klanglicht/model/yamaha}/Indirect.kt | 4 +- .../klanglicht/model/yamaha}/Language.kt | 4 +- .../klanglicht/model/yamaha}/Locator.kt | 6 +- .../kotlin/klanglicht/model/yamaha}/Menu.kt | 10 +- .../kotlin/klanglicht/model/yamaha}/Param.kt | 10 +- .../kotlin/klanglicht/model/yamaha}/Path.kt | 4 +- .../kotlin/klanglicht/model/yamaha}/Put1.kt | 4 +- .../kotlin/klanglicht/model/yamaha}/Put2.kt | 4 +- .../kotlin/klanglicht/model/yamaha}/Range.kt | 4 +- .../kotlin/klanglicht/model/yamaha}/SKey.kt | 16 +- .../kotlin/klanglicht/model/yamaha}/Text.kt | 4 +- .../model/yamaha}/UnitDescription.kt | 22 +- .../klanglicht/model/yamaha}/XmlEntity.kt | 2 +- .../model/yamahaadvantage}/ResponseCode.kt | 2 +- .../yamahaadvantage}/SoundProgramList.kt | 2 +- .../client/YamahaAvantageReceiverClient.kt | 74 ++++--- .../deviceinfo/AnalyticsInfo.kt | 6 + .../yamahaadvantage}/deviceinfo/DeviceInfo.kt | 2 +- .../yamahaadvantage}/features/Bluetooth.kt | 2 +- .../model/yamahaadvantage}/features/Ccs.kt | 2 +- .../yamahaadvantage}/features/Distribution.kt | 4 +- .../yamahaadvantage/features/Features.kt | 14 ++ .../model/yamahaadvantage}/features/Input.kt | 2 +- .../yamahaadvantage}/features/MasterRole.kt | 2 +- .../yamahaadvantage}/features/McPlaylist.kt | 2 +- .../yamahaadvantage/features/McSurround.kt | 11 + .../model/yamahaadvantage/features/Netusb.kt | 15 ++ .../yamahaadvantage}/features/PlayQueue.kt | 2 +- .../model/yamahaadvantage}/features/Preset.kt | 2 +- .../yamahaadvantage}/features/PresetX.kt | 2 +- .../model/yamahaadvantage}/features/Qobuz.kt | 2 +- .../yamahaadvantage}/features/RangeStep.kt | 2 +- .../yamahaadvantage}/features/RangeStepX.kt | 2 +- .../yamahaadvantage}/features/RecentInfo.kt | 2 +- .../yamahaadvantage}/features/SlaveRole.kt | 2 +- .../model/yamahaadvantage}/features/System.kt | 6 +- .../model/yamahaadvantage}/features/Tidal.kt | 2 +- .../model/yamahaadvantage/features/Tuner.kt | 10 + .../model/yamahaadvantage}/features/Zone.kt | 4 +- .../model/hybrid}/HybridSceneTest.kt | 19 +- .../model/preferences/ShellyDeviceTest.kt | 18 ++ .../model/shelly/ShellyColorTest.kt | 31 +++ .../model/shelly/status/LightTest.kt | 14 ++ .../preferences/preferences_livingroom.json | 6 +- .../preferences_livingroom_dummy.json | 193 ++++++++++-------- .../preferences/preferences_minimal.json | 59 ++++-- .../src/test/resources/shelly/shelly-rgb.json | 18 ++ .../rest/common/configuration/ConfigHolder.kt | 6 +- .../klanglicht/rest/dmx/handler/DmxHandler.kt | 3 +- .../rest/hybrid/model/ShellyColor.kt | 19 -- .../feign/LightmanagerFeignClient.kt | 1 + .../rest/shelly/handler/ShellyHandler.kt | 15 +- .../rest/shelly/model/html/ShellyStatus.kt | 4 +- .../rest/shelly/model/status/ActionStats.kt | 6 - .../model/status/ExternalTemperature.kt | 3 - .../rest/shelly/model/status/Humidity.kt | 3 - .../rest/shelly/model/status/Mqtt.kt | 6 - .../rest/shelly/model/status/Sensor.kt | 3 - .../rest/yamaha/feign/YamahaReceiverClient.kt | 5 +- .../yamaha/feign/YamahaReceiverFeignClient.kt | 5 +- .../YamahaAvantageReceiverRestController.kt | 2 +- .../model/deviceinfo/AnalyticsInfo.kt | 6 - .../yamahaavantage/model/features/Features.kt | 14 -- .../model/features/McSurround.kt | 11 - .../yamahaavantage/model/features/Netusb.kt | 15 -- .../yamahaavantage/model/features/Tuner.kt | 10 - .../YamahaAvantageReceiverClientTest.kt | 1 + .../test/resources/KlanglichtHandler.kt.txt | 4 +- 112 files changed, 622 insertions(+), 420 deletions(-) rename klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/{preferences => dmx}/Dmx.kt (71%) rename klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/{preferences => dmx}/DmxDevice.kt (85%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/hybrid/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/hybrid}/HybridScene.kt (94%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager}/json/Actuator.kt (81%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager}/json/ActuatorProperties.kt (91%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager}/json/Device.kt (94%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager}/json/Marker.kt (71%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager}/json/Project.kt (96%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager}/json/Scene.kt (90%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager}/json/SceneProperties.kt (90%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager}/json/Settings.kt (95%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager}/xml/Actuator.kt (84%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager}/xml/Command.kt (72%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager}/xml/Lightman.kt (93%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager}/xml/Scene.kt (71%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager}/xml/Zone.kt (81%) delete mode 100644 klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/preferences/ShellyDevice.kt rename klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/{preferences => shelly}/ColorState.kt (65%) create mode 100644 klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/ShellyColor.kt create mode 100644 klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/ShellyDevice.kt rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model}/shelly/client/ShellyClient.kt (78%) create mode 100644 klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/ActionStats.kt rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly}/status/Cloud.kt (56%) create mode 100644 klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/ExternalTemperature.kt create mode 100644 klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Humidity.kt rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly}/status/Input.kt (73%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly}/status/Light.kt (81%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly}/status/Meter.kt (85%) create mode 100644 klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Mqtt.kt rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly}/status/Relay.kt (90%) create mode 100644 klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Sensor.kt rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly}/status/Status.kt (97%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly}/status/Temperature.kt (78%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly}/status/Update.kt (81%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly}/status/WifiState.kt (67%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha}/AbstractMenuProvider.kt (89%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha}/Cmd.kt (79%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha}/CmdList.kt (67%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha}/Define.kt (75%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha}/Direct.kt (87%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha}/F.kt (80%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha}/FKey.kt (62%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha}/Get.kt (57%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha}/Indirect.kt (78%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha}/Language.kt (80%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha}/Locator.kt (72%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha}/Menu.kt (92%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha}/Param.kt (66%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha}/Path.kt (77%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha}/Put1.kt (89%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha}/Put2.kt (84%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha}/Range.kt (77%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha}/SKey.kt (56%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha}/Text.kt (75%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha}/UnitDescription.kt (58%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha}/XmlEntity.kt (83%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage}/ResponseCode.kt (67%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage}/SoundProgramList.kt (77%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage}/client/YamahaAvantageReceiverClient.kt (83%) create mode 100644 klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/deviceinfo/AnalyticsInfo.kt rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage}/deviceinfo/DeviceInfo.kt (93%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage}/features/Bluetooth.kt (75%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage}/features/Ccs.kt (58%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage}/features/Distribution.kt (54%) create mode 100644 klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Features.kt rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage}/features/Input.kt (83%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage}/features/MasterRole.kt (78%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage}/features/McPlaylist.kt (61%) create mode 100644 klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/McSurround.kt create mode 100644 klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Netusb.kt rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage}/features/PlayQueue.kt (56%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage}/features/Preset.kt (61%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage}/features/PresetX.kt (56%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage}/features/Qobuz.kt (63%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage}/features/RangeStep.kt (70%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage}/features/RangeStepX.kt (69%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage}/features/RecentInfo.kt (56%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage}/features/SlaveRole.kt (79%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage}/features/System.kt (54%) rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage}/features/Tidal.kt (56%) create mode 100644 klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Tuner.kt rename {klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model => klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage}/features/Zone.kt (84%) rename {klanglicht-rest/src/test/kotlin/de/visualdigits/kotlin/klanglicht/rest/hybrid/model => klanglicht-core/src/test/kotlin/de/visualdigits/kotlin/klanglicht/model/hybrid}/HybridSceneTest.kt (70%) create mode 100644 klanglicht-core/src/test/kotlin/de/visualdigits/kotlin/klanglicht/model/preferences/ShellyDeviceTest.kt create mode 100644 klanglicht-core/src/test/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/ShellyColorTest.kt create mode 100644 klanglicht-core/src/test/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/LightTest.kt create mode 100644 klanglicht-core/src/test/resources/shelly/shelly-rgb.json delete mode 100644 klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/hybrid/model/ShellyColor.kt delete mode 100644 klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/ActionStats.kt delete mode 100644 klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/ExternalTemperature.kt delete mode 100644 klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Humidity.kt delete mode 100644 klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Mqtt.kt delete mode 100644 klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Sensor.kt delete mode 100644 klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/deviceinfo/AnalyticsInfo.kt delete mode 100644 klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Features.kt delete mode 100644 klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/McSurround.kt delete mode 100644 klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Netusb.kt delete mode 100644 klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Tuner.kt diff --git a/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/preferences/Dmx.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/dmx/Dmx.kt similarity index 71% rename from klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/preferences/Dmx.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/dmx/Dmx.kt index c782e6a..1902305 100644 --- a/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/preferences/Dmx.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/dmx/Dmx.kt @@ -1,6 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.model.preferences - -import de.visualdigits.kotlin.klanglicht.model.dmx.DmxInterfaceType +package de.visualdigits.kotlin.klanglicht.model.dmx data class Dmx( diff --git a/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/preferences/DmxDevice.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/dmx/DmxDevice.kt similarity index 85% rename from klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/preferences/DmxDevice.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/dmx/DmxDevice.kt index 0f0652a..96c51ed 100644 --- a/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/preferences/DmxDevice.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/dmx/DmxDevice.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.model.preferences +package de.visualdigits.kotlin.klanglicht.model.dmx import com.fasterxml.jackson.annotation.JsonIgnoreProperties import de.visualdigits.kotlin.klanglicht.model.fixture.Fixture diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/hybrid/model/HybridScene.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/hybrid/HybridScene.kt similarity index 94% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/hybrid/model/HybridScene.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/hybrid/HybridScene.kt index 9377708..00606d6 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/hybrid/model/HybridScene.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/hybrid/HybridScene.kt @@ -1,14 +1,13 @@ -package de.visualdigits.kotlin.klanglicht.rest.hybrid.model +package de.visualdigits.kotlin.klanglicht.model.hybrid import de.visualdigits.kotlin.klanglicht.model.color.RGBColor -import de.visualdigits.kotlin.klanglicht.model.hybrid.HybridDevice -import de.visualdigits.kotlin.klanglicht.model.hybrid.HybridDeviceType import de.visualdigits.kotlin.klanglicht.model.parameter.Fadeable import de.visualdigits.kotlin.klanglicht.model.parameter.IntParameter import de.visualdigits.kotlin.klanglicht.model.parameter.ParameterSet import de.visualdigits.kotlin.klanglicht.model.parameter.Scene import de.visualdigits.kotlin.klanglicht.model.preferences.Preferences -import de.visualdigits.kotlin.klanglicht.rest.shelly.client.ShellyClient +import de.visualdigits.kotlin.klanglicht.model.shelly.ShellyColor +import de.visualdigits.kotlin.klanglicht.model.shelly.client.ShellyClient import kotlin.math.min import kotlin.math.roundToInt diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/json/Actuator.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/json/Actuator.kt similarity index 81% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/json/Actuator.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/json/Actuator.kt index d7b1b09..0312d1a 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/json/Actuator.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/json/Actuator.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.lightmanager.model.json +package de.visualdigits.kotlin.klanglicht.model.lightmanager.json import com.fasterxml.jackson.annotation.JsonIgnore diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/json/ActuatorProperties.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/json/ActuatorProperties.kt similarity index 91% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/json/ActuatorProperties.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/json/ActuatorProperties.kt index 4e164a5..6896e14 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/json/ActuatorProperties.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/json/ActuatorProperties.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.lightmanager.model.json +package de.visualdigits.kotlin.klanglicht.model.lightmanager.json import com.fasterxml.jackson.annotation.JsonProperty diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/json/Device.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/json/Device.kt similarity index 94% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/json/Device.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/json/Device.kt index ca20f80..91e7cf3 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/json/Device.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/json/Device.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.lightmanager.model.json +package de.visualdigits.kotlin.klanglicht.model.lightmanager.json class Device( diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/json/Marker.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/json/Marker.kt similarity index 71% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/json/Marker.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/json/Marker.kt index ef1d5df..530d306 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/json/Marker.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/json/Marker.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.lightmanager.model.json +package de.visualdigits.kotlin.klanglicht.model.lightmanager.json class Marker( diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/json/Project.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/json/Project.kt similarity index 96% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/json/Project.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/json/Project.kt index 425f253..3647f6a 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/json/Project.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/json/Project.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.lightmanager.model.json +package de.visualdigits.kotlin.klanglicht.model.lightmanager.json import com.fasterxml.jackson.annotation.JsonIgnore import com.fasterxml.jackson.databind.json.JsonMapper diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/json/Scene.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/json/Scene.kt similarity index 90% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/json/Scene.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/json/Scene.kt index d2dcee7..59519ac 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/json/Scene.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/json/Scene.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.lightmanager.model.json +package de.visualdigits.kotlin.klanglicht.model.lightmanager.json class Scene( diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/json/SceneProperties.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/json/SceneProperties.kt similarity index 90% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/json/SceneProperties.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/json/SceneProperties.kt index 8288267..aafa0d0 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/json/SceneProperties.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/json/SceneProperties.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.lightmanager.model.json +package de.visualdigits.kotlin.klanglicht.model.lightmanager.json import com.fasterxml.jackson.annotation.JsonProperty diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/json/Settings.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/json/Settings.kt similarity index 95% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/json/Settings.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/json/Settings.kt index 47d18af..40048ed 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/json/Settings.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/json/Settings.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.lightmanager.model.json +package de.visualdigits.kotlin.klanglicht.model.lightmanager.json class Settings( diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/xml/Actuator.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/xml/Actuator.kt similarity index 84% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/xml/Actuator.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/xml/Actuator.kt index 9dadaf0..e7dad1b 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/xml/Actuator.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/xml/Actuator.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.lightmanager.model.xml +package de.visualdigits.kotlin.klanglicht.model.lightmanager.xml import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/xml/Command.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/xml/Command.kt similarity index 72% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/xml/Command.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/xml/Command.kt index 6c3811d..3b7fd9f 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/xml/Command.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/xml/Command.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.lightmanager.model.xml +package de.visualdigits.kotlin.klanglicht.model.lightmanager.xml import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/xml/Lightman.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/xml/Lightman.kt similarity index 93% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/xml/Lightman.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/xml/Lightman.kt index c817392..147ffb8 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/xml/Lightman.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/xml/Lightman.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.lightmanager.model.xml +package de.visualdigits.kotlin.klanglicht.model.lightmanager.xml import com.fasterxml.jackson.dataformat.xml.XmlMapper import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/xml/Scene.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/xml/Scene.kt similarity index 71% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/xml/Scene.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/xml/Scene.kt index 55dbb6f..510a5cc 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/xml/Scene.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/xml/Scene.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.lightmanager.model.xml +package de.visualdigits.kotlin.klanglicht.model.lightmanager.xml import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/xml/Zone.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/xml/Zone.kt similarity index 81% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/xml/Zone.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/xml/Zone.kt index 12501b5..f92afe2 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/model/xml/Zone.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/lightmanager/xml/Zone.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.lightmanager.model.xml +package de.visualdigits.kotlin.klanglicht.model.lightmanager.xml import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement diff --git a/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/preferences/Preferences.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/preferences/Preferences.kt index 60ae7cd..eaf8843 100644 --- a/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/preferences/Preferences.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/preferences/Preferences.kt @@ -2,11 +2,13 @@ package de.visualdigits.kotlin.klanglicht.model.preferences import com.fasterxml.jackson.annotation.JsonIgnoreProperties import com.fasterxml.jackson.module.kotlin.jacksonMapperBuilder +import de.visualdigits.kotlin.klanglicht.model.dmx.Dmx import de.visualdigits.kotlin.klanglicht.model.dmx.DmxInterface import de.visualdigits.kotlin.klanglicht.model.dmx.DmxInterfaceDummy import de.visualdigits.kotlin.klanglicht.model.fixture.Channel import de.visualdigits.kotlin.klanglicht.model.fixture.Fixtures import de.visualdigits.kotlin.klanglicht.model.hybrid.HybridDevice +import de.visualdigits.kotlin.klanglicht.model.shelly.ShellyDevice import java.io.File import java.nio.file.Paths diff --git a/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/preferences/ShellyDevice.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/preferences/ShellyDevice.kt deleted file mode 100644 index 583155b..0000000 --- a/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/preferences/ShellyDevice.kt +++ /dev/null @@ -1,10 +0,0 @@ -package de.visualdigits.kotlin.klanglicht.model.preferences - - -data class ShellyDevice( - val name: String = "", - val model: String = "", - val command: String = "", - val ipAddress: String = "", - val gain: Float = 0.0f -) diff --git a/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/preferences/ColorState.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/ColorState.kt similarity index 65% rename from klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/preferences/ColorState.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/ColorState.kt index 21affbd..672e3bf 100644 --- a/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/preferences/ColorState.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/ColorState.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.model.preferences +package de.visualdigits.kotlin.klanglicht.model.shelly class ColorState( diff --git a/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/ShellyColor.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/ShellyColor.kt new file mode 100644 index 0000000..20b6aa4 --- /dev/null +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/ShellyColor.kt @@ -0,0 +1,43 @@ +package de.visualdigits.kotlin.klanglicht.model.shelly + +import de.visualdigits.kotlin.klanglicht.model.color.RGBColor +import de.visualdigits.kotlin.klanglicht.model.hybrid.HybridScene +import de.visualdigits.kotlin.klanglicht.model.parameter.Fadeable +import de.visualdigits.kotlin.klanglicht.model.preferences.Preferences +import de.visualdigits.kotlin.klanglicht.model.shelly.client.ShellyClient + +class ShellyColor( + val ipAddress: String, + val color: RGBColor, + val gain: Float +) : Fadeable { + + fun write() { + ShellyClient.setColor(ipAddress, color, gain) + } + + fun fade( + other: ShellyColor, + fadeDuration: Long, + preferences: Preferences + ) { + val dmxFrameTime = preferences.dmx.frameTime // millis + val step = 1.0 / fadeDuration.toDouble() * dmxFrameTime.toDouble() + var factor = 0.0 + + while (factor < 1.0) { + fade(other, factor).write() + factor += step + Thread.sleep(dmxFrameTime) + } + other.write() + } + + override fun fade(other: Any, factor: Double): ShellyColor { + return if (other is ShellyColor) { + ShellyColor(ipAddress, color.fade(other.color, factor), gain) + } else { + throw IllegalArgumentException("Cannot not fade another type") + } + } +} diff --git a/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/ShellyDevice.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/ShellyDevice.kt new file mode 100644 index 0000000..b6b7f8f --- /dev/null +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/ShellyDevice.kt @@ -0,0 +1,63 @@ +package de.visualdigits.kotlin.klanglicht.model.shelly + +import de.visualdigits.kotlin.klanglicht.model.color.RGBColor +import de.visualdigits.kotlin.klanglicht.model.shelly.client.ShellyClient +import de.visualdigits.kotlin.klanglicht.model.shelly.status.Light +import de.visualdigits.kotlin.klanglicht.model.shelly.status.Status + + +data class ShellyDevice( + val name: String = "", + val model: String = "", + val command: String = "", + val ipAddress: String = "", + val gain: Float = 0.0f +) { + + override fun toString(): String { + return "Shelly $name [$ipAddress] $model" + } + + fun setPower( + command: String, + turnOn: Boolean, + transitionDuration: Long + ): String { + return ShellyClient.setPower( + ipAddress = ipAddress, + command = command, + turnOn = turnOn, + transitionDuration = transitionDuration + ) + } + + fun setGain( + gain: Int, + transitionDuration: Long + ): String { + return ShellyClient.setGain( + ipAddress = ipAddress, + gain = gain, + transitionDuration = transitionDuration + ) + } + + fun getStatus(): Status { + return ShellyClient.getStatus(ipAddress) + } + + fun setColor( + rgbColor: RGBColor, + gain: Float = 1.0f, + transitionDuration: Long = 0, + turnOn: Boolean = true, + ): Light { + return ShellyClient.setColor( + ipAddress = ipAddress, + rgbColor = rgbColor, + gain = gain, + transitionDuration = transitionDuration, + turnOn = turnOn + ) + } +} diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/client/ShellyClient.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/client/ShellyClient.kt similarity index 78% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/client/ShellyClient.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/client/ShellyClient.kt index 59c2006..51ef2cf 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/client/ShellyClient.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/client/ShellyClient.kt @@ -1,8 +1,8 @@ -package de.visualdigits.kotlin.klanglicht.rest.shelly.client +package de.visualdigits.kotlin.klanglicht.model.shelly.client import de.visualdigits.kotlin.klanglicht.model.color.RGBColor -import de.visualdigits.kotlin.klanglicht.rest.shelly.model.status.Light -import de.visualdigits.kotlin.klanglicht.rest.shelly.model.status.Status +import de.visualdigits.kotlin.klanglicht.model.shelly.status.Light +import de.visualdigits.kotlin.klanglicht.model.shelly.status.Status import java.net.URL object ShellyClient { @@ -35,11 +35,10 @@ object ShellyClient { ipAddress: String, rgbColor: RGBColor, gain: Float, - transitionDuration: Long = 0, + transitionDuration: Long = 1, // zero is interpreted as empty which leads to the default of 2000 millis turnOn: Boolean = true, ): Light { - val json = URL( - "http://$ipAddress/color/0?" + + val url = "http://$ipAddress/color/0?" + "turn=${if (turnOn) "on" else "off"}&" + "red=${rgbColor.red}&" + "green=${rgbColor.green}&" + @@ -47,6 +46,8 @@ object ShellyClient { "white=0&" + "gain=${(100 * gain).toInt()}&" + "transition=" + transitionDuration + "&" + val json = URL( + url ).readText() return Light.load(json) } diff --git a/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/ActionStats.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/ActionStats.kt new file mode 100644 index 0000000..147f731 --- /dev/null +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/ActionStats.kt @@ -0,0 +1,6 @@ +package de.visualdigits.kotlin.klanglicht.model.shelly.status + + +class ActionStats( + val skipped: Int? = null +) diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Cloud.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Cloud.kt similarity index 56% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Cloud.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Cloud.kt index 7b4fc81..46105f0 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Cloud.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Cloud.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.shelly.model.status +package de.visualdigits.kotlin.klanglicht.model.shelly.status class Cloud( diff --git a/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/ExternalTemperature.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/ExternalTemperature.kt new file mode 100644 index 0000000..18f38e6 --- /dev/null +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/ExternalTemperature.kt @@ -0,0 +1,3 @@ +package de.visualdigits.kotlin.klanglicht.model.shelly.status + +class ExternalTemperature diff --git a/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Humidity.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Humidity.kt new file mode 100644 index 0000000..dffc69b --- /dev/null +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Humidity.kt @@ -0,0 +1,3 @@ +package de.visualdigits.kotlin.klanglicht.model.shelly.status + +class Humidity diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Input.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Input.kt similarity index 73% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Input.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Input.kt index 106281a..24c0087 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Input.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Input.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.shelly.model.status +package de.visualdigits.kotlin.klanglicht.model.shelly.status import com.fasterxml.jackson.annotation.JsonProperty diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Light.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Light.kt similarity index 81% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Light.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Light.kt index 51be806..569bcad 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Light.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Light.kt @@ -1,10 +1,12 @@ -package de.visualdigits.kotlin.klanglicht.rest.shelly.model.status +package de.visualdigits.kotlin.klanglicht.model.shelly.status import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.core.JsonProcessingException import com.fasterxml.jackson.databind.DeserializationFeature import com.fasterxml.jackson.databind.SerializationFeature import com.fasterxml.jackson.databind.json.JsonMapper +import com.fasterxml.jackson.module.kotlin.jacksonMapperBuilder +import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper class Light( @@ -26,15 +28,14 @@ class Light( @JsonProperty("overpower") val overPower: Boolean? = null ) { companion object { - val MAPPER: JsonMapper = JsonMapper - .builder() - .disable(SerializationFeature.INDENT_OUTPUT) + + private val mapper = jacksonMapperBuilder() .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) .build() fun load(json: String?): Light { return try { - MAPPER.readValue(json, Light::class.java) + mapper.readValue(json, Light::class.java) } catch (e: JsonProcessingException) { throw IllegalStateException("Could not read JSON string", e) } diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Meter.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Meter.kt similarity index 85% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Meter.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Meter.kt index c573d5c..0700b1b 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Meter.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Meter.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.shelly.model.status +package de.visualdigits.kotlin.klanglicht.model.shelly.status import com.fasterxml.jackson.annotation.JsonProperty import java.time.OffsetDateTime diff --git a/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Mqtt.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Mqtt.kt new file mode 100644 index 0000000..1327d96 --- /dev/null +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Mqtt.kt @@ -0,0 +1,6 @@ +package de.visualdigits.kotlin.klanglicht.model.shelly.status + + +class Mqtt( + val connected: Boolean? = null +) diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Relay.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Relay.kt similarity index 90% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Relay.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Relay.kt index 722cf14..8035d97 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Relay.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Relay.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.shelly.model.status +package de.visualdigits.kotlin.klanglicht.model.shelly.status import com.fasterxml.jackson.annotation.JsonProperty diff --git a/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Sensor.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Sensor.kt new file mode 100644 index 0000000..914c28f --- /dev/null +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Sensor.kt @@ -0,0 +1,3 @@ +package de.visualdigits.kotlin.klanglicht.model.shelly.status + +class Sensor diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Status.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Status.kt similarity index 97% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Status.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Status.kt index c9902d3..5ea5af8 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Status.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Status.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.shelly.model.status +package de.visualdigits.kotlin.klanglicht.model.shelly.status import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.core.JsonProcessingException diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Temperature.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Temperature.kt similarity index 78% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Temperature.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Temperature.kt index e17da2d..2c9acf0 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Temperature.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Temperature.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.shelly.model.status +package de.visualdigits.kotlin.klanglicht.model.shelly.status import com.fasterxml.jackson.annotation.JsonProperty diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Update.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Update.kt similarity index 81% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Update.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Update.kt index 102cb0c..de634d3 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Update.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/Update.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.shelly.model.status +package de.visualdigits.kotlin.klanglicht.model.shelly.status import com.fasterxml.jackson.annotation.JsonProperty diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/WifiState.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/WifiState.kt similarity index 67% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/WifiState.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/WifiState.kt index eb3cd8a..f953344 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/WifiState.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/WifiState.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.shelly.model.status +package de.visualdigits.kotlin.klanglicht.model.shelly.status class WifiState( diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/AbstractMenuProvider.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/AbstractMenuProvider.kt similarity index 89% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/AbstractMenuProvider.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/AbstractMenuProvider.kt index 392106c..bf99e97 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/AbstractMenuProvider.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/AbstractMenuProvider.kt @@ -1,11 +1,11 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamaha.model.description +package de.visualdigits.kotlin.klanglicht.model.yamaha import com.fasterxml.jackson.annotation.JsonIgnore import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty import java.util.function.Consumer -abstract class AbstractMenuProvider : XmlEntity() { +abstract class AbstractMenuProvider : de.visualdigits.kotlin.klanglicht.model.yamaha.XmlEntity() { @JacksonXmlProperty(localName = "Menu") @JacksonXmlElementWrapper(localName = "Menu", useWrapping = false) diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Cmd.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Cmd.kt similarity index 79% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Cmd.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Cmd.kt index 69693eb..c8d1b39 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Cmd.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Cmd.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamaha.model.description +package de.visualdigits.kotlin.klanglicht.model.yamaha import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement @@ -6,7 +6,7 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText @JacksonXmlRootElement(localName = "Cmd") -class Cmd : XmlEntity() { +class Cmd : de.visualdigits.kotlin.klanglicht.model.yamaha.XmlEntity() { @JacksonXmlProperty(localName = "ID", isAttribute = true) val id: String? = null diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/CmdList.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/CmdList.kt similarity index 67% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/CmdList.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/CmdList.kt index ec01d0f..49ef846 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/CmdList.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/CmdList.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamaha.model.description +package de.visualdigits.kotlin.klanglicht.model.yamaha import com.fasterxml.jackson.annotation.JsonIgnore import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper @@ -6,8 +6,8 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement @JacksonXmlRootElement(localName = "Cmd_List") -class CmdList : XmlEntity() { +class CmdList : de.visualdigits.kotlin.klanglicht.model.yamaha.XmlEntity() { @JacksonXmlProperty(localName = "Define") @JacksonXmlElementWrapper(localName = "Define", useWrapping = false) - val define: List = listOf() + val define: List = listOf() } diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Define.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Define.kt similarity index 75% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Define.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Define.kt index 8370d8d..964d793 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Define.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Define.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamaha.model.description +package de.visualdigits.kotlin.klanglicht.model.yamaha import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement @@ -6,7 +6,7 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText @JacksonXmlRootElement(localName = "Define") -class Define : XmlEntity() { +class Define : de.visualdigits.kotlin.klanglicht.model.yamaha.XmlEntity() { @JacksonXmlProperty(localName = "ID", isAttribute = true) val id: String? = null diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Direct.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Direct.kt similarity index 87% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Direct.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Direct.kt index dd56fc5..f8316be 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Direct.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Direct.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamaha.model.description +package de.visualdigits.kotlin.klanglicht.model.yamaha import com.fasterxml.jackson.annotation.JsonIgnore import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper @@ -8,7 +8,7 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText @JacksonXmlRootElement(localName = "Direct") -class Direct : XmlEntity() { +class Direct : de.visualdigits.kotlin.klanglicht.model.yamaha.XmlEntity() { @JacksonXmlProperty(localName = "Title_1", isAttribute = true) val title1: String? = null diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/F.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/F.kt similarity index 80% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/F.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/F.kt index be294fc..32a868e 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/F.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/F.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamaha.model.description +package de.visualdigits.kotlin.klanglicht.model.yamaha import com.fasterxml.jackson.annotation.JsonIgnore import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper @@ -7,7 +7,7 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText -class F : XmlEntity() { +class F : de.visualdigits.kotlin.klanglicht.model.yamaha.XmlEntity() { @JacksonXmlProperty(localName = "Title_1", isAttribute = true) val title: String? = null diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/FKey.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/FKey.kt similarity index 62% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/FKey.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/FKey.kt index dbc0f34..9a2c5f2 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/FKey.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/FKey.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamaha.model.description +package de.visualdigits.kotlin.klanglicht.model.yamaha import com.fasterxml.jackson.annotation.JsonIgnore import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper @@ -8,19 +8,19 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText @JacksonXmlRootElement(localName = "FKey") -class FKey : XmlEntity() { +class FKey : de.visualdigits.kotlin.klanglicht.model.yamaha.XmlEntity() { @JacksonXmlProperty(localName = "Title", isAttribute = true) val title: String? = null @JacksonXmlProperty(localName = "Path") - val path: Path? = null + val path: de.visualdigits.kotlin.klanglicht.model.yamaha.Path? = null @JacksonXmlProperty(localName = "F1") - val f1: F? = null + val f1: de.visualdigits.kotlin.klanglicht.model.yamaha.F? = null @JacksonXmlProperty(localName = "F2") - val f2: F? = null + val f2: de.visualdigits.kotlin.klanglicht.model.yamaha.F? = null @JacksonXmlProperty(localName = "F3") - val f3: F? = null + val f3: de.visualdigits.kotlin.klanglicht.model.yamaha.F? = null } diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Get.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Get.kt similarity index 57% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Get.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Get.kt index bc31bc3..ff83935 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Get.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Get.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamaha.model.description +package de.visualdigits.kotlin.klanglicht.model.yamaha import com.fasterxml.jackson.annotation.JsonIgnore import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper @@ -8,16 +8,16 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText @JacksonXmlRootElement(localName = "Get") -class Get : XmlEntity() { +class Get : de.visualdigits.kotlin.klanglicht.model.yamaha.XmlEntity() { @JacksonXmlProperty(localName = "Cmd") - val command: Cmd? = null + val command: de.visualdigits.kotlin.klanglicht.model.yamaha.Cmd? = null @JacksonXmlProperty(localName = "Param_1") - val param1: Param? = null + val param1: de.visualdigits.kotlin.klanglicht.model.yamaha.Param? = null @JacksonXmlProperty(localName = "Param_2") - val param2: Param? = null + val param2: de.visualdigits.kotlin.klanglicht.model.yamaha.Param? = null @JacksonXmlProperty(localName = "Param_3") - val param3: Param? = null + val param3: de.visualdigits.kotlin.klanglicht.model.yamaha.Param? = null } diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Indirect.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Indirect.kt similarity index 78% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Indirect.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Indirect.kt index eeabdf0..818f473 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Indirect.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Indirect.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamaha.model.description +package de.visualdigits.kotlin.klanglicht.model.yamaha import com.fasterxml.jackson.annotation.JsonIgnore import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper @@ -8,7 +8,7 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText @JacksonXmlRootElement(localName = "Indirect") -class Indirect : XmlEntity() { +class Indirect : de.visualdigits.kotlin.klanglicht.model.yamaha.XmlEntity() { @JacksonXmlProperty(localName = "ID", isAttribute = true) val id: String? = null } diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Language.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Language.kt similarity index 80% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Language.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Language.kt index 3c7858e..dd5a5f2 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Language.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Language.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamaha.model.description +package de.visualdigits.kotlin.klanglicht.model.yamaha import com.fasterxml.jackson.annotation.JsonIgnore import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper @@ -8,7 +8,7 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText @JacksonXmlRootElement(localName = "Language") -class Language : XmlEntity() { +class Language : de.visualdigits.kotlin.klanglicht.model.yamaha.XmlEntity() { @JacksonXmlProperty(localName = "Code", isAttribute = true) val code: String? = null diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Locator.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Locator.kt similarity index 72% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Locator.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Locator.kt index 7dec8c8..ca27345 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Locator.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Locator.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamaha.model.description +package de.visualdigits.kotlin.klanglicht.model.yamaha import com.fasterxml.jackson.annotation.JsonIgnore import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper @@ -7,12 +7,12 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText -class Locator : XmlEntity() { +class Locator : de.visualdigits.kotlin.klanglicht.model.yamaha.XmlEntity() { @JacksonXmlProperty(localName = "ID", isAttribute = true) val id: String? = null @JacksonXmlProperty(localName = "Put_1") - val put1: Put1? = null + val put1: de.visualdigits.kotlin.klanglicht.model.yamaha.Put1? = null @JacksonXmlText val value: String? = null diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Menu.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Menu.kt similarity index 92% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Menu.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Menu.kt index ec32957..e5686ee 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Menu.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Menu.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamaha.model.description +package de.visualdigits.kotlin.klanglicht.model.yamaha import org.apache.commons.lang3.StringUtils import java.util.Arrays @@ -37,21 +37,21 @@ class Menu : AbstractMenuProvider() { @JacksonXmlProperty(localName = "Put_1") @JacksonXmlElementWrapper(localName = "Put_1", useWrapping = false) - val put1: List = listOf() + val put1: List = listOf() @JacksonXmlProperty(localName = "Put_2") @JacksonXmlElementWrapper(localName = "Put_2", useWrapping = false) val put2: List = listOf() @JacksonXmlProperty(localName = "Get") - val get: Get? = null + val get: de.visualdigits.kotlin.klanglicht.model.yamaha.Get? = null @JacksonXmlProperty(localName = "Cmd_List") - val commandList: CmdList? = null + val commandList: de.visualdigits.kotlin.klanglicht.model.yamaha.CmdList? = null @JacksonXmlProperty(localName = "FKey") @JacksonXmlElementWrapper(localName = "FKey", useWrapping = false) - val fkey: List = listOf() + val fkey: List = listOf() @JacksonXmlProperty(localName = "SKey") val skey: SKey? = null diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Param.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Param.kt similarity index 66% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Param.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Param.kt index 2230ea9..c2cd81d 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Param.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Param.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamaha.model.description +package de.visualdigits.kotlin.klanglicht.model.yamaha import com.fasterxml.jackson.annotation.JsonIgnore import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper @@ -7,20 +7,20 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText -class Param : XmlEntity() { +class Param : de.visualdigits.kotlin.klanglicht.model.yamaha.XmlEntity() { @JacksonXmlProperty(localName = "Func") var function: String? = null @JacksonXmlProperty(localName = "Direct") @JacksonXmlElementWrapper(localName = "Direct", useWrapping = false) - var direct: List = listOf() + var direct: List = listOf() @JacksonXmlProperty(localName = "Indirect") var indirect: Indirect? = null @JacksonXmlProperty(localName = "Range") - var range: Range? = null + var range: de.visualdigits.kotlin.klanglicht.model.yamaha.Range? = null @JacksonXmlProperty(localName = "Text") - var text: Text? = null + var text: de.visualdigits.kotlin.klanglicht.model.yamaha.Text? = null } diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Path.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Path.kt similarity index 77% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Path.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Path.kt index 3870a3e..6c0337f 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Path.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Path.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamaha.model.description +package de.visualdigits.kotlin.klanglicht.model.yamaha import com.fasterxml.jackson.annotation.JsonIgnore import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper @@ -8,7 +8,7 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText @JacksonXmlRootElement(localName = "Path") -class Path : XmlEntity() { +class Path : de.visualdigits.kotlin.klanglicht.model.yamaha.XmlEntity() { @JacksonXmlText val value: String? = null } diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Put1.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Put1.kt similarity index 89% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Put1.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Put1.kt index a7f06fc..33c8e65 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Put1.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Put1.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamaha.model.description +package de.visualdigits.kotlin.klanglicht.model.yamaha import com.fasterxml.jackson.annotation.JsonIgnore import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper @@ -8,7 +8,7 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText @JacksonXmlRootElement(localName = "Put_1") -class Put1 : XmlEntity() { +class Put1 : de.visualdigits.kotlin.klanglicht.model.yamaha.XmlEntity() { @JacksonXmlProperty(localName = "Title_1", isAttribute = true) val title1: String? = null diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Put2.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Put2.kt similarity index 84% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Put2.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Put2.kt index a2055ab..7055899 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Put2.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Put2.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamaha.model.description +package de.visualdigits.kotlin.klanglicht.model.yamaha import com.fasterxml.jackson.annotation.JsonIgnore import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper @@ -8,7 +8,7 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText @JacksonXmlRootElement(localName = "Put_2") -class Put2 : XmlEntity() { +class Put2 : de.visualdigits.kotlin.klanglicht.model.yamaha.XmlEntity() { @JacksonXmlProperty(localName = "Cmd") val command: Cmd? = null diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Range.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Range.kt similarity index 77% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Range.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Range.kt index 835f1e1..dff18d5 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Range.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Range.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamaha.model.description +package de.visualdigits.kotlin.klanglicht.model.yamaha import com.fasterxml.jackson.annotation.JsonIgnore import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper @@ -8,7 +8,7 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText @JacksonXmlRootElement(localName = "Range") -class Range : XmlEntity() { +class Range : de.visualdigits.kotlin.klanglicht.model.yamaha.XmlEntity() { @JacksonXmlText val value: String? = null } diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/SKey.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/SKey.kt similarity index 56% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/SKey.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/SKey.kt index 9b45d31..1c12ae0 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/SKey.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/SKey.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamaha.model.description +package de.visualdigits.kotlin.klanglicht.model.yamaha import com.fasterxml.jackson.annotation.JsonIgnore import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper @@ -8,25 +8,25 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText @JacksonXmlRootElement(localName = "SKey") -class SKey : XmlEntity() { +class SKey : de.visualdigits.kotlin.klanglicht.model.yamaha.XmlEntity() { @JacksonXmlProperty(localName = "Title", isAttribute = true) val title: String? = null @JacksonXmlProperty(localName = "Path") - val path: Path? = null + val path: de.visualdigits.kotlin.klanglicht.model.yamaha.Path? = null @JacksonXmlProperty(localName = "Play") - val play: Locator? = null + val play: de.visualdigits.kotlin.klanglicht.model.yamaha.Locator? = null @JacksonXmlProperty(localName = "Pause") - val pause: Locator? = null + val pause: de.visualdigits.kotlin.klanglicht.model.yamaha.Locator? = null @JacksonXmlProperty(localName = "Stop") - val stop: Locator? = null + val stop: de.visualdigits.kotlin.klanglicht.model.yamaha.Locator? = null @JacksonXmlProperty(localName = "Fwd") - val fwd: Locator? = null + val fwd: de.visualdigits.kotlin.klanglicht.model.yamaha.Locator? = null @JacksonXmlProperty(localName = "Rev") - val rev: Locator? = null + val rev: de.visualdigits.kotlin.klanglicht.model.yamaha.Locator? = null } diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Text.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Text.kt similarity index 75% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Text.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Text.kt index 7cc6cba..785a218 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/Text.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/Text.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamaha.model.description +package de.visualdigits.kotlin.klanglicht.model.yamaha import com.fasterxml.jackson.annotation.JsonIgnore import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper @@ -7,7 +7,7 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText -class Text : XmlEntity() { +class Text : de.visualdigits.kotlin.klanglicht.model.yamaha.XmlEntity() { @JacksonXmlText val value: String? = null } diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/UnitDescription.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/UnitDescription.kt similarity index 58% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/UnitDescription.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/UnitDescription.kt index 40c4a46..34946c6 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/UnitDescription.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/UnitDescription.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamaha.model.description +package de.visualdigits.kotlin.klanglicht.model.yamaha import java.io.InputStream @@ -13,7 +13,7 @@ import java.io.IOException import java.util.stream.Collectors @JacksonXmlRootElement(localName = "Unit_Description") -class UnitDescription : AbstractMenuProvider() { +class UnitDescription : de.visualdigits.kotlin.klanglicht.model.yamaha.AbstractMenuProvider() { @JacksonXmlProperty(localName = "Version", isAttribute = true) val version: String? = null @@ -22,7 +22,7 @@ class UnitDescription : AbstractMenuProvider() { override val key: String? = null @JacksonXmlProperty(localName = "Language") - val language: Language? = null + val language: de.visualdigits.kotlin.klanglicht.model.yamaha.Language? = null override fun toString(): String { val sb = StringBuilder() @@ -33,7 +33,7 @@ class UnitDescription : AbstractMenuProvider() { val dspPrograms: Map get() { - val menu = getMenu("Main Zone/Setup/Surround/Program") + val menu = getMenu("Main Zone/Setup/Surround/Program") return menu?.put2?.get(0)?.param1?.direct?.map { direct -> Pair(direct.value!!, direct.iconOn!!) }?.toMap()?:mapOf() @@ -43,13 +43,13 @@ class UnitDescription : AbstractMenuProvider() { val mapper: XmlMapper = XmlMapper() init { - mapper.enable(SerializationFeature.INDENT_OUTPUT) + de.visualdigits.kotlin.klanglicht.model.yamaha.UnitDescription.Companion.mapper.enable(SerializationFeature.INDENT_OUTPUT) } - fun load(ins: InputStream): UnitDescription { - val unitDescription: UnitDescription + fun load(ins: InputStream): de.visualdigits.kotlin.klanglicht.model.yamaha.UnitDescription { + val unitDescription: de.visualdigits.kotlin.klanglicht.model.yamaha.UnitDescription unitDescription = try { - mapper.readValue(ins, UnitDescription::class.java) + de.visualdigits.kotlin.klanglicht.model.yamaha.UnitDescription.Companion.mapper.readValue(ins, de.visualdigits.kotlin.klanglicht.model.yamaha.UnitDescription::class.java) } catch (e: IOException) { throw IllegalStateException("Could not unmarshall file: $ins", e) } @@ -57,10 +57,10 @@ class UnitDescription : AbstractMenuProvider() { return unitDescription } - fun load(xml: String?): UnitDescription { - val unitDescription: UnitDescription + fun load(xml: String?): de.visualdigits.kotlin.klanglicht.model.yamaha.UnitDescription { + val unitDescription: de.visualdigits.kotlin.klanglicht.model.yamaha.UnitDescription unitDescription = try { - mapper.readValue(xml, UnitDescription::class.java) + de.visualdigits.kotlin.klanglicht.model.yamaha.UnitDescription.Companion.mapper.readValue(xml, de.visualdigits.kotlin.klanglicht.model.yamaha.UnitDescription::class.java) } catch (e: IOException) { throw IllegalStateException("Could not unmarshall xml", e) } diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/XmlEntity.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/XmlEntity.kt similarity index 83% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/XmlEntity.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/XmlEntity.kt index 3beabfb..35f352c 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/model/description/XmlEntity.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamaha/XmlEntity.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamaha.model.description +package de.visualdigits.kotlin.klanglicht.model.yamaha import com.fasterxml.jackson.annotation.JsonIgnore import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/ResponseCode.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/ResponseCode.kt similarity index 67% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/ResponseCode.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/ResponseCode.kt index fc50b4f..3b4ca09 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/ResponseCode.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/ResponseCode.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model +package de.visualdigits.kotlin.klanglicht.model.yamahaadvantage import com.fasterxml.jackson.annotation.JsonProperty diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/SoundProgramList.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/SoundProgramList.kt similarity index 77% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/SoundProgramList.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/SoundProgramList.kt index 700c8df..2972188 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/SoundProgramList.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/SoundProgramList.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model +package de.visualdigits.kotlin.klanglicht.model.yamahaadvantage import com.fasterxml.jackson.annotation.JsonProperty diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/client/YamahaAvantageReceiverClient.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/client/YamahaAvantageReceiverClient.kt similarity index 83% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/client/YamahaAvantageReceiverClient.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/client/YamahaAvantageReceiverClient.kt index 2d25eea..16b5f0f 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/client/YamahaAvantageReceiverClient.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/client/YamahaAvantageReceiverClient.kt @@ -1,49 +1,15 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.client +package de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.client import com.fasterxml.jackson.core.JsonProcessingException import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper -import de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model.deviceinfo.DeviceInfo -import de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model.ResponseCode -import de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model.SoundProgramList -import de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model.features.Features +import de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.deviceinfo.DeviceInfo +import de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.ResponseCode +import de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.SoundProgramList import java.net.URL -import java.nio.charset.StandardCharsets class YamahaAvantageReceiverClient(val yamahaReceiverUrl: String) { - fun deviceInfo(): DeviceInfo { - val deviceInfo = URL("$yamahaReceiverUrl/YamahaExtendedControl/v1/system/getDeviceInfo").readText() - return mapper.readValue(deviceInfo, DeviceInfo::class.java) - } - - fun features(): Features { - val features = URL("$yamahaReceiverUrl/YamahaExtendedControl/v1/system/getFeatures").readText() - return mapper.readValue(features, Features::class.java) - } - - fun soundProgramList(): SoundProgramList { - val soundProgramList = URL("$yamahaReceiverUrl/YamahaExtendedControl/v1/main/getSoundProgramList").readText() - return mapper.readValue(soundProgramList, SoundProgramList::class.java) - } - - fun setVolume(volume: Int) { - URL("$yamahaReceiverUrl/YamahaExtendedControl/v1/main/setVolume?volume=$volume").readText() - } - - fun setSurroundProgram(program: String): ResponseCode { - println("Setting program '${mapPrograms[program]}'") - return try { - mapPrograms[program] - ?.let { URL("$yamahaReceiverUrl/YamahaExtendedControl/v1/main/setSoundProgram?program=$it").readText() } - ?.let { mapper.readValue(it, ResponseCode::class.java) } - ?: ResponseCode(0) - - } catch (e: JsonProcessingException) { - throw IllegalStateException("Could not read from api", e) - } - } - companion object { private val mapper = jacksonObjectMapper() @@ -76,4 +42,36 @@ class YamahaAvantageReceiverClient(val yamahaReceiverUrl: String) { mapPrograms["Surround Decoder"] = "surr_decoder" } } + + fun deviceInfo(): DeviceInfo { + val deviceInfo = URL("$yamahaReceiverUrl/YamahaExtendedControl/v1/system/getDeviceInfo").readText() + return mapper.readValue(deviceInfo, DeviceInfo::class.java) + } + + fun features(): de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.Features { + val features = URL("$yamahaReceiverUrl/YamahaExtendedControl/v1/system/getFeatures").readText() + return mapper.readValue(features, de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.Features::class.java) + } + + fun soundProgramList(): SoundProgramList { + val soundProgramList = URL("$yamahaReceiverUrl/YamahaExtendedControl/v1/main/getSoundProgramList").readText() + return mapper.readValue(soundProgramList, SoundProgramList::class.java) + } + + fun setVolume(volume: Int) { + URL("$yamahaReceiverUrl/YamahaExtendedControl/v1/main/setVolume?volume=$volume").readText() + } + + fun setSurroundProgram(program: String): ResponseCode { + println("Setting program '${mapPrograms[program]}'") + return try { + mapPrograms[program] + ?.let { URL("$yamahaReceiverUrl/YamahaExtendedControl/v1/main/setSoundProgram?program=$it").readText() } + ?.let { mapper.readValue(it, ResponseCode::class.java) } + ?: ResponseCode(0) + + } catch (e: JsonProcessingException) { + throw IllegalStateException("Could not read from api", e) + } + } } diff --git a/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/deviceinfo/AnalyticsInfo.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/deviceinfo/AnalyticsInfo.kt new file mode 100644 index 0000000..212ea2f --- /dev/null +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/deviceinfo/AnalyticsInfo.kt @@ -0,0 +1,6 @@ +package de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.deviceinfo + + +data class AnalyticsInfo( + val uuid: String = "" +) diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/deviceinfo/DeviceInfo.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/deviceinfo/DeviceInfo.kt similarity index 93% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/deviceinfo/DeviceInfo.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/deviceinfo/DeviceInfo.kt index e5517dc..0df6c4b 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/deviceinfo/DeviceInfo.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/deviceinfo/DeviceInfo.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model.deviceinfo +package de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.deviceinfo import com.fasterxml.jackson.annotation.JsonProperty diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Bluetooth.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Bluetooth.kt similarity index 75% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Bluetooth.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Bluetooth.kt index 2e400cb..023af87 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Bluetooth.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Bluetooth.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model.features +package de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features import com.fasterxml.jackson.annotation.JsonProperty diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Ccs.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Ccs.kt similarity index 58% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Ccs.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Ccs.kt index 49f0786..cc5d318 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Ccs.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Ccs.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model.features +package de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features import com.fasterxml.jackson.annotation.JsonProperty diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Distribution.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Distribution.kt similarity index 54% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Distribution.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Distribution.kt index 0c01ea8..90b21c5 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Distribution.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Distribution.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model.features +package de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features import com.fasterxml.jackson.annotation.JsonProperty @@ -8,5 +8,5 @@ data class Distribution( @JsonProperty("compatible_client") val compatibleClient: List = listOf(), @JsonProperty("client_max") val clientMax: Int = 0, @JsonProperty("server_zone_list") val serverZoneList: List = listOf(), - @JsonProperty("mc_surround") val mcSurround: McSurround = McSurround() + @JsonProperty("mc_surround") val mcSurround: de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.McSurround = de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.McSurround() ) diff --git a/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Features.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Features.kt new file mode 100644 index 0000000..32d3d30 --- /dev/null +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Features.kt @@ -0,0 +1,14 @@ +package de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features + + +import com.fasterxml.jackson.annotation.JsonProperty + +data class Features( + @JsonProperty("response_code") val responseCode: Int = 0, + val system: de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.System = de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.System(), + val zone: List = listOf(), + val tuner: de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.Tuner = de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.Tuner(), + val netusb: de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.Netusb = de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.Netusb(), + val distribution: de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.Distribution = de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.Distribution(), + val ccs: de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.Ccs = de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.Ccs() +) diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Input.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Input.kt similarity index 83% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Input.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Input.kt index d4020d4..be0ab3f 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Input.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Input.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model.features +package de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features import com.fasterxml.jackson.annotation.JsonProperty diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/MasterRole.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/MasterRole.kt similarity index 78% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/MasterRole.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/MasterRole.kt index d90bee8..782f342 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/MasterRole.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/MasterRole.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model.features +package de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features import com.fasterxml.jackson.annotation.JsonProperty diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/McPlaylist.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/McPlaylist.kt similarity index 61% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/McPlaylist.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/McPlaylist.kt index 6768228..1da8b38 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/McPlaylist.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/McPlaylist.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model.features +package de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features import com.fasterxml.jackson.annotation.JsonProperty diff --git a/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/McSurround.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/McSurround.kt new file mode 100644 index 0000000..262f33c --- /dev/null +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/McSurround.kt @@ -0,0 +1,11 @@ +package de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features + + +import com.fasterxml.jackson.annotation.JsonProperty + +data class McSurround( + val version: Double = 0.0, + @JsonProperty("func_list") val funcList: List = listOf(), + @JsonProperty("master_role") val masterRole: de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.MasterRole = de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.MasterRole(), + @JsonProperty("slave_role") val slaveRole: de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.SlaveRole = de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.SlaveRole() +) diff --git a/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Netusb.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Netusb.kt new file mode 100644 index 0000000..79b2849 --- /dev/null +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Netusb.kt @@ -0,0 +1,15 @@ +package de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features + + +import com.fasterxml.jackson.annotation.JsonProperty + +data class Netusb( + @JsonProperty("func_list") val funcList: List = listOf(), + val preset: de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.PresetX = de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.PresetX(), + @JsonProperty("recent_info") val recentInfo: de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.RecentInfo = de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.RecentInfo(), + @JsonProperty("play_queue") val playQueue: de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.PlayQueue = de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.PlayQueue(), + @JsonProperty("mc_playlist") val mcPlaylist: de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.McPlaylist = de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.McPlaylist(), + @JsonProperty("net_radio_type") val netRadioType: String = "", + val tidal: de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.Tidal = de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.Tidal(), + val qobuz: de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.Qobuz = de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.Qobuz() +) diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/PlayQueue.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/PlayQueue.kt similarity index 56% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/PlayQueue.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/PlayQueue.kt index 5fe2718..416a544 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/PlayQueue.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/PlayQueue.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model.features +package de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features import com.fasterxml.jackson.annotation.JsonProperty diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Preset.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Preset.kt similarity index 61% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Preset.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Preset.kt index 93515fa..48407ff 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Preset.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Preset.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model.features +package de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features import com.fasterxml.jackson.annotation.JsonProperty diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/PresetX.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/PresetX.kt similarity index 56% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/PresetX.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/PresetX.kt index f448ffa..58da72a 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/PresetX.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/PresetX.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model.features +package de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features import com.fasterxml.jackson.annotation.JsonProperty diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Qobuz.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Qobuz.kt similarity index 63% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Qobuz.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Qobuz.kt index 934cee4..6f86683 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Qobuz.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Qobuz.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model.features +package de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features import com.fasterxml.jackson.annotation.JsonProperty diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/RangeStep.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/RangeStep.kt similarity index 70% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/RangeStep.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/RangeStep.kt index 91a1e36..2020aee 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/RangeStep.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/RangeStep.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model.features +package de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features import com.fasterxml.jackson.annotation.JsonProperty diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/RangeStepX.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/RangeStepX.kt similarity index 69% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/RangeStepX.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/RangeStepX.kt index 0913833..0766eb6 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/RangeStepX.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/RangeStepX.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model.features +package de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features import com.fasterxml.jackson.annotation.JsonProperty diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/RecentInfo.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/RecentInfo.kt similarity index 56% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/RecentInfo.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/RecentInfo.kt index 440f154..a36ccd7 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/RecentInfo.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/RecentInfo.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model.features +package de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features import com.fasterxml.jackson.annotation.JsonProperty diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/SlaveRole.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/SlaveRole.kt similarity index 79% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/SlaveRole.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/SlaveRole.kt index 6f295d0..527fd2c 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/SlaveRole.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/SlaveRole.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model.features +package de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features import com.fasterxml.jackson.annotation.JsonProperty diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/System.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/System.kt similarity index 54% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/System.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/System.kt index 9af7081..910d88f 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/System.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/System.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model.features +package de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features import com.fasterxml.jackson.annotation.JsonProperty @@ -6,8 +6,8 @@ import com.fasterxml.jackson.annotation.JsonProperty data class System( @JsonProperty("func_list") val funcList: List = listOf(), @JsonProperty("zone_num") val zoneNum: Int = 0, - @JsonProperty("input_list") val inputList: List = listOf(), - val bluetooth: Bluetooth = Bluetooth(), + @JsonProperty("input_list") val inputList: List = listOf(), + val bluetooth: de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.Bluetooth = de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.Bluetooth(), @JsonProperty("web_control_url") val webControlUrl: String = "", @JsonProperty("party_volume_list") val partyVolumeList: List = listOf(), @JsonProperty("hdmi_standby_through_list") val hdmiStandbyThroughList: List = listOf() diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Tidal.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Tidal.kt similarity index 56% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Tidal.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Tidal.kt index 9d267e6..7e08676 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Tidal.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Tidal.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model.features +package de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features import com.fasterxml.jackson.annotation.JsonProperty diff --git a/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Tuner.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Tuner.kt new file mode 100644 index 0000000..1714a1a --- /dev/null +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Tuner.kt @@ -0,0 +1,10 @@ +package de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features + + +import com.fasterxml.jackson.annotation.JsonProperty + +data class Tuner( + @JsonProperty("func_list") val funcList: List = listOf(), + @JsonProperty("range_step") val rangeStep: List = listOf(), + val preset: de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.Preset = de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features.Preset() +) diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Zone.kt b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Zone.kt similarity index 84% rename from klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Zone.kt rename to klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Zone.kt index 53e87eb..5e61c7e 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Zone.kt +++ b/klanglicht-core/src/main/kotlin/de/visualdigits/kotlin/klanglicht/model/yamahaadvantage/features/Zone.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model.features +package de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.features import com.fasterxml.jackson.annotation.JsonProperty @@ -12,7 +12,7 @@ data class Zone( @JsonProperty("tone_control_mode_list") val toneControlModeList: List = listOf(), @JsonProperty("link_control_list") val linkControlList: List = listOf(), @JsonProperty("link_audio_delay_list") val linkAudioDelayList: List? = listOf(), - @JsonProperty("range_step") val rangeStep: List = listOf(), + @JsonProperty("range_step") val rangeStep: List = listOf(), @JsonProperty("scene_num") val sceneNum: Int = 0, @JsonProperty("cursor_list") val cursorList: List? = listOf(), @JsonProperty("menu_list") val menuList: List? = listOf(), diff --git a/klanglicht-rest/src/test/kotlin/de/visualdigits/kotlin/klanglicht/rest/hybrid/model/HybridSceneTest.kt b/klanglicht-core/src/test/kotlin/de/visualdigits/kotlin/klanglicht/model/hybrid/HybridSceneTest.kt similarity index 70% rename from klanglicht-rest/src/test/kotlin/de/visualdigits/kotlin/klanglicht/rest/hybrid/model/HybridSceneTest.kt rename to klanglicht-core/src/test/kotlin/de/visualdigits/kotlin/klanglicht/model/hybrid/HybridSceneTest.kt index 8de7690..3c815d6 100644 --- a/klanglicht-rest/src/test/kotlin/de/visualdigits/kotlin/klanglicht/rest/hybrid/model/HybridSceneTest.kt +++ b/klanglicht-core/src/test/kotlin/de/visualdigits/kotlin/klanglicht/model/hybrid/HybridSceneTest.kt @@ -1,4 +1,4 @@ -package de.visualdigits.kotlin.klanglicht.rest.hybrid.model +package de.visualdigits.kotlin.klanglicht.model.hybrid import de.visualdigits.kotlin.klanglicht.model.preferences.Preferences import org.apache.commons.lang3.SystemUtils @@ -17,19 +17,20 @@ class HybridSceneTest { gains = "", preferences = preferences ) - println(scene1) +// println(scene1) val scene2 = HybridScene( ids = "Starwars,Rgbw,15,29,Bar", hexColors = "#00ffff,#ff00ff,#ffff00,#0000ff,#ff0000", gains = "", preferences = preferences ) - println(scene2) - println() - val n = 10 - for (f in 0 until n) { - val faded = scene1.fade(scene2, f.toDouble() / n) - println(faded) - } + Thread.sleep(5000) +// println(scene2) +// println() +// val n = 10 +// for (f in 0 until n) { +// val faded = scene1.fade(scene2, f.toDouble() / n) +// println(faded) +// } } } diff --git a/klanglicht-core/src/test/kotlin/de/visualdigits/kotlin/klanglicht/model/preferences/ShellyDeviceTest.kt b/klanglicht-core/src/test/kotlin/de/visualdigits/kotlin/klanglicht/model/preferences/ShellyDeviceTest.kt new file mode 100644 index 0000000..f714381 --- /dev/null +++ b/klanglicht-core/src/test/kotlin/de/visualdigits/kotlin/klanglicht/model/preferences/ShellyDeviceTest.kt @@ -0,0 +1,18 @@ +package de.visualdigits.kotlin.klanglicht.model.preferences + +import de.visualdigits.kotlin.klanglicht.model.color.RGBColor +import org.junit.jupiter.api.Test +import java.io.File + +class ShellyDeviceTest { + + val preferences = Preferences.load( + klanglichtDir = File(ClassLoader.getSystemResource(".klanglicht").toURI()), + preferencesFileName = "preferences_livingroom_dummy.json" + ) + + @Test + fun testSetColor() { + preferences.shellyMap["Starwars"]?.setColor(RGBColor(0,0,255)) + } +} diff --git a/klanglicht-core/src/test/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/ShellyColorTest.kt b/klanglicht-core/src/test/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/ShellyColorTest.kt new file mode 100644 index 0000000..dce6f39 --- /dev/null +++ b/klanglicht-core/src/test/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/ShellyColorTest.kt @@ -0,0 +1,31 @@ +package de.visualdigits.kotlin.klanglicht.model.shelly + +import de.visualdigits.kotlin.klanglicht.model.color.RGBColor +import de.visualdigits.kotlin.klanglicht.model.preferences.Preferences +import org.junit.jupiter.api.Test +import java.io.File + +class ShellyColorTest { + + val preferences = Preferences.load( + klanglichtDir = File(ClassLoader.getSystemResource(".klanglicht").toURI()), + preferencesFileName = "preferences_livingroom_dummy.json" + ) + + @Test + fun testFade() { + val shellyDevice = preferences.shellyMap["Starwars"] + if (shellyDevice != null) { + val color1 = ShellyColor(shellyDevice.ipAddress, RGBColor(255, 0, 0), 1.0f) + val color2 = ShellyColor(shellyDevice.ipAddress, RGBColor(0, 255, 0), 1.0f) +// color2.write() + + for (i in 0 until 5) { + color1.fade(color2, 2000, preferences) + Thread.sleep(2000) + color2.fade(color1, 2000, preferences) + Thread.sleep(2000) + } + } + } +} diff --git a/klanglicht-core/src/test/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/LightTest.kt b/klanglicht-core/src/test/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/LightTest.kt new file mode 100644 index 0000000..d65bd59 --- /dev/null +++ b/klanglicht-core/src/test/kotlin/de/visualdigits/kotlin/klanglicht/model/shelly/status/LightTest.kt @@ -0,0 +1,14 @@ +package de.visualdigits.kotlin.klanglicht.model.shelly.status + +import org.junit.jupiter.api.Assertions.* +import org.junit.jupiter.api.Test +import java.io.File + +class LightTest { + + @Test + fun testModel() { + val json = File(ClassLoader.getSystemResource("shelly/shelly-rgb.json").toURI()).readText() + val light = Light.load(json) + } +} diff --git a/klanglicht-core/src/test/resources/.klanglicht/preferences/preferences_livingroom.json b/klanglicht-core/src/test/resources/.klanglicht/preferences/preferences_livingroom.json index 6fad87c..ad57f78 100644 --- a/klanglicht-core/src/test/resources/.klanglicht/preferences/preferences_livingroom.json +++ b/klanglicht-core/src/test/resources/.klanglicht/preferences/preferences_livingroom.json @@ -21,19 +21,19 @@ "name": "Starwars", "model": "shelly-rgbw", "ipAddress": "192.168.178.54", - "gain": 30 + "gain": 0.2 }, { "name": "Rgbw", "model": "shelly-rgbw", "ipAddress": "192.168.178.48", - "gain": 1 + "gain": 0.1 }, { "name": "Bar", "model": "shelly-rgbw", "ipAddress": "192.168.178.55", - "gain": 20 + "gain": 0.1 }, { "name": "Flur", diff --git a/klanglicht-core/src/test/resources/.klanglicht/preferences/preferences_livingroom_dummy.json b/klanglicht-core/src/test/resources/.klanglicht/preferences/preferences_livingroom_dummy.json index df6bfd6..8df7684 100644 --- a/klanglicht-core/src/test/resources/.klanglicht/preferences/preferences_livingroom_dummy.json +++ b/klanglicht-core/src/test/resources/.klanglicht/preferences/preferences_livingroom_dummy.json @@ -1,108 +1,137 @@ { - "name" : "wohnzimmer", + "name": "wohnzimmer", "services": [ { "name": "lmair", - "manufacturer" : "JB-Media", - "model" : "Light-Manager Air", + "manufacturer": "JB-Media", + "model": "Light-Manager Air", "url": "http://192.168.178.28" }, { "name": "receiver", - "manufacturer" : "Yamaha", - "model" : "RX-V6A", + "manufacturer": "Yamaha", + "model": "RX-V6A", "url": "http://192.168.178.46" } ], - "shelly": { + "shelly": [ + { + "name": "Starwars", + "model": "shelly-rgbw", + "ipAddress": "192.168.178.54", + "gain": 0.2 + }, + { + "name": "Rgbw", + "model": "shelly-rgbw", + "ipAddress": "192.168.178.48", + "gain": 0.1 + }, + { + "name": "Bar", + "model": "shelly-rgbw", + "ipAddress": "192.168.178.55", + "gain": 0.1 + }, + { + "name": "Flur", + "model": "shelly-1", + "ipAddress": "192.168.178.38", + "gain": 0 + }, + { + "name": "Schlafzimmer", + "model": "shelly-1", + "ipAddress": "192.168.178.40", + "gain": 0 + }, + { + "name": "Wohnzimmer", + "model": "shelly-2.5", + "ipAddress": "192.168.178.37", + "gain": 0 + }, + { + "name": "Kristall", + "model": "plug-s", + "ipAddress": "192.168.178.51", + "gain": 0 + }, + { + "name": "Regal", + "model": "shelly-plug-s", + "ipAddress": "192.168.178.39", + "gain": 0 + } + ], + + "dmx": { + "port": "", + "interfaceType": "Dummy", + "frameTime": 40, + "enableRepeater": false, "devices": [ { - "name": "Starwars", - "model": "shelly-rgbw", - "ipAddress": "192.168.178.54", - "gain": 30 - }, - { - "name": "Rgbw", - "model": "shelly-rgbw", - "ipAddress": "192.168.178.48", - "gain": 1 + "manufacturer": "Cameo", + "model": "Flat PAR Can RGB 10 IR", + "mode": "6-Channel Mode", + "baseChannel": 1, + "gain": 1.0 }, { - "name": "Bar", - "model": "shelly-rgbw", - "ipAddress": "192.168.178.55", - "gain": 20 + "manufacturer": "Cameo", + "model": "Flat PAR Can RGBW", + "mode": "8-Channel Mode", + "baseChannel": 21, + "gain": 1.0 }, { - "name": "Flur", - "model": "shelly-1", - "ipAddress": "192.168.178.38", - "gain": 0 + "manufacturer": "Cameo", + "model": "Flat PAR Can RGB 10 IR", + "mode": "6-Channel Mode", + "baseChannel": 15, + "gain": 1.0 }, { - "name": "Schlafzimmer", - "model": "shelly-1", - "ipAddress": "192.168.178.40", - "gain": 0 - }, - { - "name": "Wohnzimmer", - "model": "shelly-2.5", - "ipAddress": "192.168.178.37", - "gain": 0 - }, - { - "name": "Kristall", - "model": "plug-s", - "ipAddress": "192.168.178.51", - "gain": 0 - }, - { - "name": "Regal", - "model": "shelly-plug-s", - "ipAddress": "192.168.178.39", - "gain": 0 + "manufacturer": "Cameo", + "model": "Flat PAR Can RGB 10 IR", + "mode": "6-Channel Mode", + "baseChannel": 29, + "gain": 1.0 } ] }, - "dmx": { - "port": "COM8", - "interfaceType": "Dummy", - "frameTime": 40, - "devices" : [ { - "manufacturer" : "Cameo", - "model" : "Flat PAR Can RGB 10 IR", - "mode" : "6-Channel Mode", - "baseChannel" : 1, - "gain": 0.5 - }, { - "manufacturer" : "Cameo", - "model" : "Flat PAR Can RGBW", - "mode" : "8-Channel Mode", - "baseChannel" : 7, - "gain": 1.0 - }, { - "manufacturer" : "Cameo", - "model" : "Flat PAR Can RGB 10 IR", - "mode" : "6-Channel Mode", - "baseChannel" : 15, - "gain": 0.5 - }, { - "manufacturer" : "Cameo", - "model" : "Flat PAR Can RGBW", - "mode" : "8-Channel Mode", - "baseChannel" : 21, - "gain": 1.0 - }, { - "manufacturer" : "Cameo", - "model" : "Flat PAR Can RGB 10 IR", - "mode" : "6-Channel Mode", - "baseChannel" : 29, - "gain": 0.5 - } ] - } + "stage": [ + { + "type": "shelly", + "id": "Starwars" + }, + { + "type": "shelly", + "id": "Rgbw" + }, + { + "type": "dmx", + "id": "15" + }, + { + "type": "dmx", + "id": "29" + }, + { + "type": "dmx", + "id": "21" + }, + { + "type": "dmx", + "id": "1" + }, + { + "type": "shelly", + "id": "Bar" + } + ] } diff --git a/klanglicht-core/src/test/resources/.klanglicht/preferences/preferences_minimal.json b/klanglicht-core/src/test/resources/.klanglicht/preferences/preferences_minimal.json index f61413f..5ed5d84 100644 --- a/klanglicht-core/src/test/resources/.klanglicht/preferences/preferences_minimal.json +++ b/klanglicht-core/src/test/resources/.klanglicht/preferences/preferences_minimal.json @@ -1,17 +1,17 @@ { - "name" : "wohnzimmer", + "name": "wohnzimmer", "services": [ { "name": "lmair", - "manufacturer" : "JB-Media", - "model" : "Light-Manager Air", + "manufacturer": "JB-Media", + "model": "Light-Manager Air", "url": "http://192.168.178.28" }, { "name": "receiver", - "manufacturer" : "Yamaha", - "model" : "RX-V6A", + "manufacturer": "Yamaha", + "model": "RX-V6A", "url": "http://192.168.178.46" } ], @@ -21,19 +21,19 @@ "name": "Starwars", "model": "shelly-rgbw", "ipAddress": "192.168.178.54", - "gain": 30 + "gain": 0.2 }, { "name": "Rgbw", "model": "shelly-rgbw", "ipAddress": "192.168.178.48", - "gain": 1 + "gain": 0.1 }, { "name": "Bar", "model": "shelly-rgbw", "ipAddress": "192.168.178.55", - "gain": 20 + "gain": 0.1 }, { "name": "Flur", @@ -72,19 +72,36 @@ "interfaceType": "Serial", "frameTime": 40, "enableRepeater": false, - "devices" : [ { - "manufacturer" : "Cameo", - "model" : "Flat PAR Can RGB 10 IR", - "mode" : "6-Channel Mode", - "baseChannel" : 15, - "gain": 0.5 - }, { - "manufacturer" : "Cameo", - "model" : "Flat PAR Can RGB 10 IR", - "mode" : "6-Channel Mode", - "baseChannel" : 29, - "gain": 0.5 - } ] + "devices": [ + { + "manufacturer": "Cameo", + "model": "Flat PAR Can RGB 10 IR", + "mode": "6-Channel Mode", + "baseChannel": 1, + "gain": 1.0 + }, + { + "manufacturer": "Cameo", + "model": "Flat PAR Can RGBW", + "mode": "8-Channel Mode", + "baseChannel": 21, + "gain": 1.0 + }, + { + "manufacturer": "Cameo", + "model": "Flat PAR Can RGB 10 IR", + "mode": "6-Channel Mode", + "baseChannel": 15, + "gain": 1.0 + }, + { + "manufacturer": "Cameo", + "model": "Flat PAR Can RGB 10 IR", + "mode": "6-Channel Mode", + "baseChannel": 29, + "gain": 1.0 + } + ] }, "stage": [ diff --git a/klanglicht-core/src/test/resources/shelly/shelly-rgb.json b/klanglicht-core/src/test/resources/shelly/shelly-rgb.json new file mode 100644 index 0000000..3688f75 --- /dev/null +++ b/klanglicht-core/src/test/resources/shelly/shelly-rgb.json @@ -0,0 +1,18 @@ +{ + "ison": true, + "source": "http", + "has_timer": false, + "timer_started": 0, + "timer_duration": 0, + "timer_remaining": 0, + "mode": "color", + "red": 255, + "green": 255, + "blue": 0, + "white": 0, + "gain": 100, + "effect": 0, + "transition": 0, + "power": 22.90, + "overpower": false +} diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/common/configuration/ConfigHolder.kt b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/common/configuration/ConfigHolder.kt index e869847..41740c3 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/common/configuration/ConfigHolder.kt +++ b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/common/configuration/ConfigHolder.kt @@ -4,10 +4,10 @@ import com.fasterxml.jackson.annotation.JsonIgnore import de.visualdigits.kotlin.klanglicht.model.dmx.DmxInterface import de.visualdigits.kotlin.klanglicht.model.dmx.DmxInterfaceType import de.visualdigits.kotlin.klanglicht.model.dmx.DmxRepeater -import de.visualdigits.kotlin.klanglicht.model.preferences.ColorState -import de.visualdigits.kotlin.klanglicht.model.preferences.DmxDevice +import de.visualdigits.kotlin.klanglicht.model.shelly.ColorState +import de.visualdigits.kotlin.klanglicht.model.dmx.DmxDevice import de.visualdigits.kotlin.klanglicht.model.preferences.Preferences -import de.visualdigits.kotlin.klanglicht.model.preferences.ShellyDevice +import de.visualdigits.kotlin.klanglicht.model.shelly.ShellyDevice import jakarta.annotation.PostConstruct import jakarta.annotation.PreDestroy import org.apache.commons.lang3.StringUtils diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/dmx/handler/DmxHandler.kt b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/dmx/handler/DmxHandler.kt index 2a36fd1..3cb01d2 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/dmx/handler/DmxHandler.kt +++ b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/dmx/handler/DmxHandler.kt @@ -1,12 +1,11 @@ package de.visualdigits.kotlin.klanglicht.rest.dmx.handler import de.visualdigits.kotlin.klanglicht.model.color.RGBColor -import de.visualdigits.kotlin.klanglicht.model.color.RGBWColor import de.visualdigits.kotlin.klanglicht.model.hybrid.HybridDeviceType import de.visualdigits.kotlin.klanglicht.model.parameter.IntParameter import de.visualdigits.kotlin.klanglicht.model.parameter.ParameterSet import de.visualdigits.kotlin.klanglicht.model.parameter.Scene -import de.visualdigits.kotlin.klanglicht.model.preferences.ColorState +import de.visualdigits.kotlin.klanglicht.model.shelly.ColorState import de.visualdigits.kotlin.klanglicht.rest.common.configuration.ConfigHolder import jakarta.annotation.PostConstruct import org.slf4j.Logger diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/hybrid/model/ShellyColor.kt b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/hybrid/model/ShellyColor.kt deleted file mode 100644 index 49db5d2..0000000 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/hybrid/model/ShellyColor.kt +++ /dev/null @@ -1,19 +0,0 @@ -package de.visualdigits.kotlin.klanglicht.rest.hybrid.model - -import de.visualdigits.kotlin.klanglicht.model.color.RGBColor -import de.visualdigits.kotlin.klanglicht.model.parameter.Fadeable - -class ShellyColor( - val ipAddress: String, - val color: RGBColor, - val gain: Float -): Fadeable { - - override fun fade(other: Any, factor: Double): ShellyColor { - return if (other is ShellyColor) { - ShellyColor(ipAddress, color.fade(other.color, factor), gain) - } else { - throw IllegalArgumentException("Cannot not fade another type") - } - } -} diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/feign/LightmanagerFeignClient.kt b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/feign/LightmanagerFeignClient.kt index ba6d67b..14240d7 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/feign/LightmanagerFeignClient.kt +++ b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/lightmanager/feign/LightmanagerFeignClient.kt @@ -8,6 +8,7 @@ import feign.okhttp.OkHttpClient import feign.slf4j.Slf4jLogger interface LightmanagerFeignClient { + @RequestLine("GET /") fun html(): String? diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/handler/ShellyHandler.kt b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/handler/ShellyHandler.kt index 817d9ee..a1e7422 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/handler/ShellyHandler.kt +++ b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/handler/ShellyHandler.kt @@ -1,13 +1,13 @@ package de.visualdigits.kotlin.klanglicht.rest.shelly.handler import de.visualdigits.kotlin.klanglicht.model.color.RGBColor -import de.visualdigits.kotlin.klanglicht.model.preferences.ColorState -import de.visualdigits.kotlin.klanglicht.model.preferences.ShellyDevice +import de.visualdigits.kotlin.klanglicht.model.shelly.ColorState +import de.visualdigits.kotlin.klanglicht.model.shelly.ShellyDevice import de.visualdigits.kotlin.klanglicht.rest.common.configuration.ConfigHolder import de.visualdigits.kotlin.klanglicht.rest.lightmanager.feign.LightmanagerClient -import de.visualdigits.kotlin.klanglicht.rest.shelly.client.ShellyClient -import de.visualdigits.kotlin.klanglicht.rest.shelly.model.status.Light -import de.visualdigits.kotlin.klanglicht.rest.shelly.model.status.Status +import de.visualdigits.kotlin.klanglicht.model.shelly.client.ShellyClient +import de.visualdigits.kotlin.klanglicht.model.shelly.status.Light +import de.visualdigits.kotlin.klanglicht.model.shelly.status.Status import org.apache.commons.lang3.StringUtils import org.slf4j.Logger import org.slf4j.LoggerFactory @@ -303,15 +303,14 @@ class ShellyHandler { val ipAddress: String = shellyDevice.ipAddress log.info("setColor: $ipAddress") try { - ShellyClient.setColor( - ipAddress = ipAddress, + shellyDevice.setColor( rgbColor = rgbColor, gain = gain, transitionDuration = transitionDuration, turnOn = turnOn ) } catch (e: Exception) { - log.warn("Could not set color for shelly at '$ipAddress'") + log.warn("Could not set color for shelly device '$shellyDevice'") null } } else null diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/html/ShellyStatus.kt b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/html/ShellyStatus.kt index f70416b..fcd08a1 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/html/ShellyStatus.kt +++ b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/html/ShellyStatus.kt @@ -2,10 +2,10 @@ package de.visualdigits.kotlin.klanglicht.rest.shelly.model.html import de.visualdigits.kotlin.klanglicht.rest.common.configuration.ConfigHolder import de.visualdigits.kotlin.klanglicht.model.color.RGBColor -import de.visualdigits.kotlin.klanglicht.model.preferences.ShellyDevice +import de.visualdigits.kotlin.klanglicht.model.shelly.ShellyDevice import de.visualdigits.kotlin.klanglicht.rest.lightmanager.model.html.HtmlRenderable import de.visualdigits.kotlin.klanglicht.rest.shelly.handler.ShellyHandler -import de.visualdigits.kotlin.klanglicht.rest.shelly.model.status.Status +import de.visualdigits.kotlin.klanglicht.model.shelly.status.Status class ShellyStatus : HtmlRenderable { diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/ActionStats.kt b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/ActionStats.kt deleted file mode 100644 index 817f215..0000000 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/ActionStats.kt +++ /dev/null @@ -1,6 +0,0 @@ -package de.visualdigits.kotlin.klanglicht.rest.shelly.model.status - - -class ActionStats( - val skipped: Int? = null -) diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/ExternalTemperature.kt b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/ExternalTemperature.kt deleted file mode 100644 index 7ee59f3..0000000 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/ExternalTemperature.kt +++ /dev/null @@ -1,3 +0,0 @@ -package de.visualdigits.kotlin.klanglicht.rest.shelly.model.status - -class ExternalTemperature diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Humidity.kt b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Humidity.kt deleted file mode 100644 index 155bf40..0000000 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Humidity.kt +++ /dev/null @@ -1,3 +0,0 @@ -package de.visualdigits.kotlin.klanglicht.rest.shelly.model.status - -class Humidity diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Mqtt.kt b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Mqtt.kt deleted file mode 100644 index b4e5c8f..0000000 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Mqtt.kt +++ /dev/null @@ -1,6 +0,0 @@ -package de.visualdigits.kotlin.klanglicht.rest.shelly.model.status - - -class Mqtt( - val connected: Boolean? = null -) diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Sensor.kt b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Sensor.kt deleted file mode 100644 index ae4d3ff..0000000 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/shelly/model/status/Sensor.kt +++ /dev/null @@ -1,3 +0,0 @@ -package de.visualdigits.kotlin.klanglicht.rest.shelly.model.status - -class Sensor diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/feign/YamahaReceiverClient.kt b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/feign/YamahaReceiverClient.kt index 2b1d557..514af7c 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/feign/YamahaReceiverClient.kt +++ b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/feign/YamahaReceiverClient.kt @@ -1,14 +1,13 @@ package de.visualdigits.kotlin.klanglicht.rest.yamaha.feign -import de.visualdigits.kotlin.klanglicht.rest.yamaha.model.description.Menu -import de.visualdigits.kotlin.klanglicht.rest.yamaha.model.description.UnitDescription +import de.visualdigits.kotlin.klanglicht.model.yamaha.Menu class YamahaReceiverClient( val yamahaReceiverUrl: String ) { var client: YamahaReceiverFeignClient? = null - var unitDescription: UnitDescription? = null + var unitDescription: de.visualdigits.kotlin.klanglicht.model.yamaha.UnitDescription? = null init { client = YamahaReceiverFeignClient.Companion.client(yamahaReceiverUrl) diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/feign/YamahaReceiverFeignClient.kt b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/feign/YamahaReceiverFeignClient.kt index dd6f875..9e18204 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/feign/YamahaReceiverFeignClient.kt +++ b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamaha/feign/YamahaReceiverFeignClient.kt @@ -1,6 +1,5 @@ package de.visualdigits.kotlin.klanglicht.rest.yamaha.feign -import de.visualdigits.kotlin.klanglicht.rest.yamaha.model.description.UnitDescription import feign.Feign import feign.Headers import feign.Logger @@ -11,10 +10,10 @@ import feign.slf4j.Slf4jLogger interface YamahaReceiverFeignClient { @RequestLine("GET /YamahaRemoteControl/desc.xml") fun description(): String - val unitDescription: UnitDescription? + val unitDescription: de.visualdigits.kotlin.klanglicht.model.yamaha.UnitDescription? get() { val json = description() - return UnitDescription.Companion.load(json) + return de.visualdigits.kotlin.klanglicht.model.yamaha.UnitDescription.Companion.load(json) } @RequestLine("POST /YamahaRemoteControl/ctrl") diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/controller/YamahaAvantageReceiverRestController.kt b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/controller/YamahaAvantageReceiverRestController.kt index 4a8bcf5..3402a42 100644 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/controller/YamahaAvantageReceiverRestController.kt +++ b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/controller/YamahaAvantageReceiverRestController.kt @@ -1,7 +1,7 @@ package de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.controller import de.visualdigits.kotlin.klanglicht.rest.common.configuration.ConfigHolder -import de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.client.YamahaAvantageReceiverClient +import de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.client.YamahaAvantageReceiverClient import org.slf4j.Logger import org.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Autowired diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/deviceinfo/AnalyticsInfo.kt b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/deviceinfo/AnalyticsInfo.kt deleted file mode 100644 index fb11eaf..0000000 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/deviceinfo/AnalyticsInfo.kt +++ /dev/null @@ -1,6 +0,0 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model.deviceinfo - - -data class AnalyticsInfo( - val uuid: String = "" -) diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Features.kt b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Features.kt deleted file mode 100644 index e67480f..0000000 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Features.kt +++ /dev/null @@ -1,14 +0,0 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model.features - - -import com.fasterxml.jackson.annotation.JsonProperty - -data class Features( - @JsonProperty("response_code") val responseCode: Int = 0, - val system: System = System(), - val zone: List = listOf(), - val tuner: Tuner = Tuner(), - val netusb: Netusb = Netusb(), - val distribution: Distribution = Distribution(), - val ccs: Ccs = Ccs() -) diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/McSurround.kt b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/McSurround.kt deleted file mode 100644 index 66c26aa..0000000 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/McSurround.kt +++ /dev/null @@ -1,11 +0,0 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model.features - - -import com.fasterxml.jackson.annotation.JsonProperty - -data class McSurround( - val version: Double = 0.0, - @JsonProperty("func_list") val funcList: List = listOf(), - @JsonProperty("master_role") val masterRole: MasterRole = MasterRole(), - @JsonProperty("slave_role") val slaveRole: SlaveRole = SlaveRole() -) diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Netusb.kt b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Netusb.kt deleted file mode 100644 index dcdde88..0000000 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Netusb.kt +++ /dev/null @@ -1,15 +0,0 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model.features - - -import com.fasterxml.jackson.annotation.JsonProperty - -data class Netusb( - @JsonProperty("func_list") val funcList: List = listOf(), - val preset: PresetX = PresetX(), - @JsonProperty("recent_info") val recentInfo: RecentInfo = RecentInfo(), - @JsonProperty("play_queue") val playQueue: PlayQueue = PlayQueue(), - @JsonProperty("mc_playlist") val mcPlaylist: McPlaylist = McPlaylist(), - @JsonProperty("net_radio_type") val netRadioType: String = "", - val tidal: Tidal = Tidal(), - val qobuz: Qobuz = Qobuz() -) diff --git a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Tuner.kt b/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Tuner.kt deleted file mode 100644 index 5d82a5f..0000000 --- a/klanglicht-rest/src/main/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/model/features/Tuner.kt +++ /dev/null @@ -1,10 +0,0 @@ -package de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.model.features - - -import com.fasterxml.jackson.annotation.JsonProperty - -data class Tuner( - @JsonProperty("func_list") val funcList: List = listOf(), - @JsonProperty("range_step") val rangeStep: List = listOf(), - val preset: Preset = Preset() -) diff --git a/klanglicht-rest/src/test/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/client/YamahaAvantageReceiverClientTest.kt b/klanglicht-rest/src/test/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/client/YamahaAvantageReceiverClientTest.kt index 1646e86..baad78b 100644 --- a/klanglicht-rest/src/test/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/client/YamahaAvantageReceiverClientTest.kt +++ b/klanglicht-rest/src/test/kotlin/de/visualdigits/kotlin/klanglicht/rest/yamahaavantage/client/YamahaAvantageReceiverClientTest.kt @@ -1,6 +1,7 @@ package de.visualdigits.kotlin.klanglicht.rest.yamahaavantage.client import de.visualdigits.kotlin.klanglicht.model.preferences.Preferences +import de.visualdigits.kotlin.klanglicht.model.yamahaadvantage.client.YamahaAvantageReceiverClient import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/klanglicht-rest/src/test/resources/KlanglichtHandler.kt.txt b/klanglicht-rest/src/test/resources/KlanglichtHandler.kt.txt index ee9b4a4..247ce34 100644 --- a/klanglicht-rest/src/test/resources/KlanglichtHandler.kt.txt +++ b/klanglicht-rest/src/test/resources/KlanglichtHandler.kt.txt @@ -6,10 +6,10 @@ import de.visualdigits.kotlin.klanglicht.model.color.RGBWColor import de.visualdigits.kotlin.klanglicht.model.dmx.DmxFrame import de.visualdigits.kotlin.klanglicht.model.parameter.Parameter import de.visualdigits.kotlin.klanglicht.model.parameter.ParameterSet -import de.visualdigits.kotlin.klanglicht.model.preferences.ColorState +import de.visualdigits.kotlin.klanglicht.model.shelly.ColorState import de.visualdigits.kotlin.klanglicht.model.preferences.Preferences import de.visualdigits.kotlin.klanglicht.rest.common.configuration.ConfigHolder -import de.visualdigits.kotlin.klanglicht.rest.lightmanager.model.json.Scene +import de.visualdigits.kotlin.klanglicht.model.lightmanager.json.Scene import jakarta.annotation.PostConstruct import org.slf4j.Logger import org.slf4j.LoggerFactory