@fastybird/smart-panel-backend 1.1.0-alpha.5 → 1.1.0-alpha.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.module.js +9 -1
- package/dist/app.module.js.map +1 -1
- package/dist/common/utils/cancellable-exec.utils.d.ts +5 -0
- package/dist/common/utils/cancellable-exec.utils.js +34 -0
- package/dist/common/utils/cancellable-exec.utils.js.map +1 -0
- package/dist/common/utils/remote-access-observation.utils.d.ts +11 -0
- package/dist/common/utils/remote-access-observation.utils.js +89 -0
- package/dist/common/utils/remote-access-observation.utils.js.map +1 -0
- package/dist/dataSource.js +1 -0
- package/dist/dataSource.js.map +1 -1
- package/dist/migrations/1000000000026-AddHardwareInputCategories.d.ts +7 -0
- package/dist/migrations/1000000000026-AddHardwareInputCategories.js +364 -0
- package/dist/migrations/1000000000026-AddHardwareInputCategories.js.map +1 -0
- package/dist/modules/auth/auth.module.js +4 -0
- package/dist/modules/auth/auth.module.js.map +1 -1
- package/dist/modules/auth/guards/auth.guard.js +8 -21
- package/dist/modules/auth/guards/auth.guard.js.map +1 -1
- package/dist/modules/auth/services/token-metadata.service.d.ts +42 -0
- package/dist/modules/auth/services/token-metadata.service.js +202 -0
- package/dist/modules/auth/services/token-metadata.service.js.map +1 -0
- package/dist/modules/auth/services/token-usage.service.d.ts +22 -0
- package/dist/modules/auth/services/token-usage.service.js +93 -0
- package/dist/modules/auth/services/token-usage.service.js.map +1 -0
- package/dist/modules/auth/services/tokens.service.d.ts +10 -3
- package/dist/modules/auth/services/tokens.service.js +26 -10
- package/dist/modules/auth/services/tokens.service.js.map +1 -1
- package/dist/modules/devices/controllers/channels.controller.d.ts +5 -1
- package/dist/modules/devices/controllers/channels.controller.js +34 -2
- package/dist/modules/devices/controllers/channels.controller.js.map +1 -1
- package/dist/modules/devices/controllers/channels.properties.controller.js +21 -4
- package/dist/modules/devices/controllers/channels.properties.controller.js.map +1 -1
- package/dist/modules/devices/controllers/devices.channels.controller.d.ts +5 -1
- package/dist/modules/devices/controllers/devices.channels.controller.js +38 -2
- package/dist/modules/devices/controllers/devices.channels.controller.js.map +1 -1
- package/dist/modules/devices/controllers/devices.channels.properties.controller.js +21 -4
- package/dist/modules/devices/controllers/devices.channels.properties.controller.js.map +1 -1
- package/dist/modules/devices/devices.constants.d.ts +6 -0
- package/dist/modules/devices/devices.constants.js +6 -0
- package/dist/modules/devices/devices.constants.js.map +1 -1
- package/dist/modules/devices/devices.module.js +27 -0
- package/dist/modules/devices/devices.module.js.map +1 -1
- package/dist/modules/devices/devices.openapi.d.ts +3 -1
- package/dist/modules/devices/devices.openapi.js +7 -0
- package/dist/modules/devices/devices.openapi.js.map +1 -1
- package/dist/modules/devices/dto/channel-input-occurrence.dto.d.ts +10 -0
- package/dist/modules/devices/dto/channel-input-occurrence.dto.js +99 -0
- package/dist/modules/devices/dto/channel-input-occurrence.dto.js.map +1 -0
- package/dist/modules/devices/dto/property-command.dto.js +2 -8
- package/dist/modules/devices/dto/property-command.dto.js.map +1 -1
- package/dist/modules/devices/models/channel-input-capabilities.model.d.ts +20 -0
- package/dist/modules/devices/models/channel-input-capabilities.model.js +111 -0
- package/dist/modules/devices/models/channel-input-capabilities.model.js.map +1 -0
- package/dist/modules/devices/models/channel-input-occurrence.model.d.ts +22 -0
- package/dist/modules/devices/models/channel-input-occurrence.model.js +154 -0
- package/dist/modules/devices/models/channel-input-occurrence.model.js.map +1 -0
- package/dist/modules/devices/services/channel-input-deduplication.service.d.ts +17 -0
- package/dist/modules/devices/services/channel-input-deduplication.service.js +88 -0
- package/dist/modules/devices/services/channel-input-deduplication.service.js.map +1 -0
- package/dist/modules/devices/services/channel-input-occurrences.service.d.ts +21 -0
- package/dist/modules/devices/services/channel-input-occurrences.service.js +163 -0
- package/dist/modules/devices/services/channel-input-occurrences.service.js.map +1 -0
- package/dist/modules/devices/services/channels.properties.service.d.ts +32 -3
- package/dist/modules/devices/services/channels.properties.service.js +360 -51
- package/dist/modules/devices/services/channels.properties.service.js.map +1 -1
- package/dist/modules/devices/services/channels.service.d.ts +1 -0
- package/dist/modules/devices/services/channels.service.js +52 -38
- package/dist/modules/devices/services/channels.service.js.map +1 -1
- package/dist/modules/devices/services/command-latency-trace-collector.service.d.ts +101 -0
- package/dist/modules/devices/services/command-latency-trace-collector.service.js +451 -0
- package/dist/modules/devices/services/command-latency-trace-collector.service.js.map +1 -0
- package/dist/modules/devices/services/device-command-graph.service.d.ts +18 -0
- package/dist/modules/devices/services/device-command-graph.service.js +92 -0
- package/dist/modules/devices/services/device-command-graph.service.js.map +1 -0
- package/dist/modules/devices/services/device-structure-lock.service.d.ts +10 -2
- package/dist/modules/devices/services/device-structure-lock.service.js +86 -7
- package/dist/modules/devices/services/device-structure-lock.service.js.map +1 -1
- package/dist/modules/devices/services/devices.service.d.ts +2 -0
- package/dist/modules/devices/services/devices.service.js +78 -64
- package/dist/modules/devices/services/devices.service.js.map +1 -1
- package/dist/modules/devices/services/module-reset.service.d.ts +3 -1
- package/dist/modules/devices/services/module-reset.service.js +21 -16
- package/dist/modules/devices/services/module-reset.service.js.map +1 -1
- package/dist/modules/devices/services/platform.registry.service.d.ts +2 -2
- package/dist/modules/devices/services/platform.registry.service.js.map +1 -1
- package/dist/modules/devices/services/property-command-dispatch.service.d.ts +47 -0
- package/dist/modules/devices/services/property-command-dispatch.service.js +231 -0
- package/dist/modules/devices/services/property-command-dispatch.service.js.map +1 -0
- package/dist/modules/devices/services/property-command-window.service.d.ts +71 -0
- package/dist/modules/devices/services/property-command-window.service.js +206 -0
- package/dist/modules/devices/services/property-command-window.service.js.map +1 -0
- package/dist/modules/devices/services/property-command.service.d.ts +26 -7
- package/dist/modules/devices/services/property-command.service.js +95 -28
- package/dist/modules/devices/services/property-command.service.js.map +1 -1
- package/dist/modules/devices/services/property-metadata.service.d.ts +38 -0
- package/dist/modules/devices/services/property-metadata.service.js +210 -0
- package/dist/modules/devices/services/property-metadata.service.js.map +1 -0
- package/dist/modules/devices/services/property-state-coordinator.service.d.ts +4 -0
- package/dist/modules/devices/services/property-state-coordinator.service.js +35 -0
- package/dist/modules/devices/services/property-state-coordinator.service.js.map +1 -0
- package/dist/modules/devices/services/property-value-lock.service.d.ts +4 -1
- package/dist/modules/devices/services/property-value-lock.service.js +16 -2
- package/dist/modules/devices/services/property-value-lock.service.js.map +1 -1
- package/dist/modules/devices/services/property-value.service.d.ts +3 -0
- package/dist/modules/devices/services/property-value.service.js +29 -5
- package/dist/modules/devices/services/property-value.service.js.map +1 -1
- package/dist/modules/devices/utils/device-graph-query.utils.d.ts +3 -0
- package/dist/modules/devices/utils/device-graph-query.utils.js +23 -0
- package/dist/modules/devices/utils/device-graph-query.utils.js.map +1 -0
- package/dist/modules/devices/utils/schema.utils.js +1 -1
- package/dist/modules/devices/utils/schema.utils.js.map +1 -1
- package/dist/modules/devices/validators/channel-exists-constraint.validator.d.ts +1 -3
- package/dist/modules/devices/validators/channel-exists-constraint.validator.js +3 -14
- package/dist/modules/devices/validators/channel-exists-constraint.validator.js.map +1 -1
- package/dist/modules/devices/validators/channel-property-exists-constraint.validator.d.ts +1 -3
- package/dist/modules/devices/validators/channel-property-exists-constraint.validator.js +3 -14
- package/dist/modules/devices/validators/channel-property-exists-constraint.validator.js.map +1 -1
- package/dist/modules/devices/validators/device-exists-constraint.validator.js +1 -2
- package/dist/modules/devices/validators/device-exists-constraint.validator.js.map +1 -1
- package/dist/modules/devices/validators/property-command-target-constraint.validator.d.ts +9 -0
- package/dist/modules/devices/validators/property-command-target-constraint.validator.js +58 -0
- package/dist/modules/devices/validators/property-command-target-constraint.validator.js.map +1 -0
- package/dist/modules/mdns/services/mdns.service.js +3 -1
- package/dist/modules/mdns/services/mdns.service.js.map +1 -1
- package/dist/modules/platform/platforms/abstract.platform.d.ts +2 -1
- package/dist/modules/platform/platforms/abstract.platform.js +2 -1
- package/dist/modules/platform/platforms/abstract.platform.js.map +1 -1
- package/dist/modules/platform/platforms/raspberry.platform.js +5 -10
- package/dist/modules/platform/platforms/raspberry.platform.js.map +1 -1
- package/dist/modules/platform/utils/linux-network-interface.utils.d.ts +3 -0
- package/dist/modules/platform/utils/linux-network-interface.utils.js +48 -0
- package/dist/modules/platform/utils/linux-network-interface.utils.js.map +1 -0
- package/dist/modules/remote-access/controllers/remote-access.controller.js +11 -6
- package/dist/modules/remote-access/controllers/remote-access.controller.js.map +1 -1
- package/dist/modules/remote-access/models/provider.model.d.ts +3 -0
- package/dist/modules/remote-access/models/provider.model.js +23 -0
- package/dist/modules/remote-access/models/provider.model.js.map +1 -1
- package/dist/modules/remote-access/models/status.model.d.ts +2 -0
- package/dist/modules/remote-access/models/status.model.js +18 -1
- package/dist/modules/remote-access/models/status.model.js.map +1 -1
- package/dist/modules/remote-access/models/urls.model.d.ts +2 -0
- package/dist/modules/remote-access/models/urls.model.js +17 -0
- package/dist/modules/remote-access/models/urls.model.js.map +1 -1
- package/dist/modules/remote-access/platforms/remote-access-provider.platform.d.ts +18 -1
- package/dist/modules/remote-access/remote-access.constants.d.ts +2 -1
- package/dist/modules/remote-access/remote-access.constants.js +2 -1
- package/dist/modules/remote-access/remote-access.constants.js.map +1 -1
- package/dist/modules/remote-access/services/remote-access-proxy-contribution.service.d.ts +1 -0
- package/dist/modules/remote-access/services/remote-access-proxy-contribution.service.js +4 -1
- package/dist/modules/remote-access/services/remote-access-proxy-contribution.service.js.map +1 -1
- package/dist/modules/remote-access/services/remote-access-status.service.d.ts +40 -8
- package/dist/modules/remote-access/services/remote-access-status.service.js +314 -65
- package/dist/modules/remote-access/services/remote-access-status.service.js.map +1 -1
- package/dist/modules/remote-access/services/remote-access-url.service.d.ts +2 -2
- package/dist/modules/remote-access/services/remote-access-url.service.js +4 -2
- package/dist/modules/remote-access/services/remote-access-url.service.js.map +1 -1
- package/dist/modules/spaces/services/module-reset.service.d.ts +5 -1
- package/dist/modules/spaces/services/module-reset.service.js +10 -2
- package/dist/modules/spaces/services/module-reset.service.js.map +1 -1
- package/dist/modules/spaces/services/space-activity.service.d.ts +14 -0
- package/dist/modules/spaces/services/space-activity.service.js +56 -0
- package/dist/modules/spaces/services/space-activity.service.js.map +1 -0
- package/dist/modules/spaces/spaces.module.js +5 -0
- package/dist/modules/spaces/spaces.module.js.map +1 -1
- package/dist/modules/spaces/subscribers/space-activity.subscriber.d.ts +17 -0
- package/dist/modules/spaces/subscribers/space-activity.subscriber.js +89 -0
- package/dist/modules/spaces/subscribers/space-activity.subscriber.js.map +1 -0
- package/dist/modules/storage/services/storage-write-buffer.d.ts +17 -0
- package/dist/modules/storage/services/storage-write-buffer.js +67 -0
- package/dist/modules/storage/services/storage-write-buffer.js.map +1 -0
- package/dist/modules/storage/services/storage.service.d.ts +9 -2
- package/dist/modules/storage/services/storage.service.js +54 -1
- package/dist/modules/storage/services/storage.service.js.map +1 -1
- package/dist/modules/system/scripts/update-worker.sh +1168 -61
- package/dist/modules/system/services/privileged-worker.service.d.ts +3 -0
- package/dist/modules/system/services/privileged-worker.service.js +62 -27
- package/dist/modules/system/services/privileged-worker.service.js.map +1 -1
- package/dist/modules/system/services/system.service.d.ts +2 -0
- package/dist/modules/system/services/system.service.js +22 -1
- package/dist/modules/system/services/system.service.js.map +1 -1
- package/dist/modules/system/services/update-executor.service.d.ts +20 -2
- package/dist/modules/system/services/update-executor.service.js +272 -26
- package/dist/modules/system/services/update-executor.service.js.map +1 -1
- package/dist/modules/websocket/gateway/websocket.gateway.d.ts +4 -1
- package/dist/modules/websocket/gateway/websocket.gateway.js +29 -5
- package/dist/modules/websocket/gateway/websocket.gateway.js.map +1 -1
- package/dist/modules/websocket/services/command-acknowledgement-trace.service.d.ts +143 -0
- package/dist/modules/websocket/services/command-acknowledgement-trace.service.js +523 -0
- package/dist/modules/websocket/services/command-acknowledgement-trace.service.js.map +1 -0
- package/dist/modules/websocket/services/ws-auth.service.js +12 -35
- package/dist/modules/websocket/services/ws-auth.service.js.map +1 -1
- package/dist/modules/websocket/websocket.module.js +9 -1
- package/dist/modules/websocket/websocket.module.js.map +1 -1
- package/dist/plugins/devices-home-assistant/devices-home-assistant.openapi.d.ts +2 -2
- package/dist/plugins/devices-home-assistant/devices-home-assistant.plugin.d.ts +6 -1
- package/dist/plugins/devices-home-assistant/devices-home-assistant.plugin.js +16 -1
- package/dist/plugins/devices-home-assistant/devices-home-assistant.plugin.js.map +1 -1
- package/dist/plugins/devices-home-assistant/dto/mapping-preview.dto.d.ts +1 -0
- package/dist/plugins/devices-home-assistant/dto/mapping-preview.dto.js +11 -0
- package/dist/plugins/devices-home-assistant/dto/mapping-preview.dto.js.map +1 -1
- package/dist/plugins/devices-home-assistant/mappers/button.entity.mapper.service.d.ts +19 -0
- package/dist/plugins/devices-home-assistant/mappers/button.entity.mapper.service.js +51 -0
- package/dist/plugins/devices-home-assistant/mappers/button.entity.mapper.service.js.map +1 -0
- package/dist/plugins/devices-home-assistant/mappings/definitions/entity-mappings.yaml +56 -7
- package/dist/plugins/devices-home-assistant/models/mapping-preview.model.d.ts +1 -0
- package/dist/plugins/devices-home-assistant/models/mapping-preview.model.js +11 -0
- package/dist/plugins/devices-home-assistant/models/mapping-preview.model.js.map +1 -1
- package/dist/plugins/devices-home-assistant/services/device-adoption.service.js +17 -0
- package/dist/plugins/devices-home-assistant/services/device-adoption.service.js.map +1 -1
- package/dist/plugins/devices-home-assistant/services/ha-mdns-discoverer.service.js +3 -1
- package/dist/plugins/devices-home-assistant/services/ha-mdns-discoverer.service.js.map +1 -1
- package/dist/plugins/devices-home-assistant/services/home-assistant-raw-event.service.d.ts +27 -0
- package/dist/plugins/devices-home-assistant/services/home-assistant-raw-event.service.js +271 -0
- package/dist/plugins/devices-home-assistant/services/home-assistant-raw-event.service.js.map +1 -0
- package/dist/plugins/devices-home-assistant/services/home-assistant.ws.service.d.ts +2 -2
- package/dist/plugins/devices-home-assistant/services/home-assistant.ws.service.js +33 -14
- package/dist/plugins/devices-home-assistant/services/home-assistant.ws.service.js.map +1 -1
- package/dist/plugins/devices-home-assistant/services/mapping-preview.service.js +24 -4
- package/dist/plugins/devices-home-assistant/services/mapping-preview.service.js.map +1 -1
- package/dist/plugins/devices-home-assistant/services/state-changed.event.service.d.ts +4 -1
- package/dist/plugins/devices-home-assistant/services/state-changed.event.service.js +84 -5
- package/dist/plugins/devices-home-assistant/services/state-changed.event.service.js.map +1 -1
- package/dist/plugins/devices-home-assistant/services/wizard.service.js +1 -0
- package/dist/plugins/devices-home-assistant/services/wizard.service.js.map +1 -1
- package/dist/plugins/devices-home-assistant/utils/ha-event.utils.d.ts +2 -0
- package/dist/plugins/devices-home-assistant/utils/ha-event.utils.js +50 -0
- package/dist/plugins/devices-home-assistant/utils/ha-event.utils.js.map +1 -0
- package/dist/plugins/devices-homekit/listeners/homekit-event.listener.d.ts +4 -1
- package/dist/plugins/devices-homekit/listeners/homekit-event.listener.js +39 -4
- package/dist/plugins/devices-homekit/listeners/homekit-event.listener.js.map +1 -1
- package/dist/plugins/devices-homekit/mappers/base.mapper.js +30 -6
- package/dist/plugins/devices-homekit/mappers/base.mapper.js.map +1 -1
- package/dist/plugins/devices-homekit/mappers/button.mapper.d.ts +15 -0
- package/dist/plugins/devices-homekit/mappers/button.mapper.js +143 -0
- package/dist/plugins/devices-homekit/mappers/button.mapper.js.map +1 -0
- package/dist/plugins/devices-homekit/mappers/characteristic-write.d.ts +2 -0
- package/dist/plugins/devices-homekit/mappers/characteristic-write.js +17 -0
- package/dist/plugins/devices-homekit/mappers/characteristic-write.js.map +1 -0
- package/dist/plugins/devices-homekit/mappers/homekit-mapper.interface.d.ts +17 -1
- package/dist/plugins/devices-homekit/mappers/thermostat-coordinator.d.ts +7 -0
- package/dist/plugins/devices-homekit/mappers/thermostat-coordinator.js +96 -84
- package/dist/plugins/devices-homekit/mappers/thermostat-coordinator.js.map +1 -1
- package/dist/plugins/devices-homekit/services/homekit-bridge.service.js +2 -0
- package/dist/plugins/devices-homekit/services/homekit-bridge.service.js.map +1 -1
- package/dist/plugins/devices-homekit/services/homekit-mapper-registry.service.d.ts +5 -1
- package/dist/plugins/devices-homekit/services/homekit-mapper-registry.service.js +42 -0
- package/dist/plugins/devices-homekit/services/homekit-mapper-registry.service.js.map +1 -1
- package/dist/plugins/devices-homekit/utils/ciao-receive-guard.d.ts +1 -0
- package/dist/plugins/devices-homekit/utils/ciao-receive-guard.js +36 -0
- package/dist/plugins/devices-homekit/utils/ciao-receive-guard.js.map +1 -0
- package/dist/plugins/devices-homey/mappings/definitions/channels.yaml +50 -0
- package/dist/plugins/devices-homey/mappings/definitions/devices.yaml +18 -0
- package/dist/plugins/devices-homey/mappings/definitions/properties.yaml +55 -0
- package/dist/plugins/devices-homey/mappings/device-support.js +10 -0
- package/dist/plugins/devices-homey/mappings/device-support.js.map +1 -1
- package/dist/plugins/devices-homey/mappings/mapping-loader.service.d.ts +1 -0
- package/dist/plugins/devices-homey/mappings/mapping-loader.service.js +66 -8
- package/dist/plugins/devices-homey/mappings/mapping-loader.service.js.map +1 -1
- package/dist/plugins/devices-homey/models/inventory.model.d.ts +2 -1
- package/dist/plugins/devices-homey/models/inventory.model.js +1 -0
- package/dist/plugins/devices-homey/models/inventory.model.js.map +1 -1
- package/dist/plugins/devices-homey/models/mapping-preview.model.d.ts +1 -0
- package/dist/plugins/devices-homey/models/mapping-preview.model.js +1 -0
- package/dist/plugins/devices-homey/models/mapping-preview.model.js.map +1 -1
- package/dist/plugins/devices-homey/services/homey-mapping-preview.service.js +7 -0
- package/dist/plugins/devices-homey/services/homey-mapping-preview.service.js.map +1 -1
- package/dist/plugins/devices-homey/services/homey-synchronizer.service.d.ts +3 -1
- package/dist/plugins/devices-homey/services/homey-synchronizer.service.js +37 -6
- package/dist/plugins/devices-homey/services/homey-synchronizer.service.js.map +1 -1
- package/dist/plugins/devices-reterminal/services/reterminal-button.service.d.ts +7 -3
- package/dist/plugins/devices-reterminal/services/reterminal-button.service.js +63 -17
- package/dist/plugins/devices-reterminal/services/reterminal-button.service.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/delegates/delegates-manager.service.d.ts +36 -3
- package/dist/plugins/devices-shelly-ng/delegates/delegates-manager.service.js +707 -42
- package/dist/plugins/devices-shelly-ng/delegates/delegates-manager.service.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/delegates/shelly-device.delegate.d.ts +11 -1
- package/dist/plugins/devices-shelly-ng/delegates/shelly-device.delegate.js +100 -10
- package/dist/plugins/devices-shelly-ng/delegates/shelly-device.delegate.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/devices-shelly-ng.constants.js +3 -2
- package/dist/plugins/devices-shelly-ng/devices-shelly-ng.constants.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/devices-shelly-ng.plugin.js +2 -0
- package/dist/plugins/devices-shelly-ng/devices-shelly-ng.plugin.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/mappings/definitions/inputs.yaml +80 -0
- package/dist/plugins/devices-shelly-ng/mappings/mapping-loader.service.js +7 -1
- package/dist/plugins/devices-shelly-ng/mappings/mapping-loader.service.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/mappings/mapping.types.d.ts +6 -3
- package/dist/plugins/devices-shelly-ng/mappings/schema/mapping-schema.json +5 -0
- package/dist/plugins/devices-shelly-ng/services/device-manager.service.js +153 -8
- package/dist/plugins/devices-shelly-ng/services/device-manager.service.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/services/poll-placement-diagnostics.service.d.ts +51 -0
- package/dist/plugins/devices-shelly-ng/services/poll-placement-diagnostics.service.js +549 -0
- package/dist/plugins/devices-shelly-ng/services/poll-placement-diagnostics.service.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-ng.service.d.ts +15 -2
- package/dist/plugins/devices-shelly-ng/services/shelly-ng.service.js +140 -35
- package/dist/plugins/devices-shelly-ng/services/shelly-ng.service.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/services/shelly-rpc-client.service.js +3 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-rpc-client.service.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/services/shelly-ws-server.service.d.ts +1 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-ws-server.service.js +14 -4
- package/dist/plugins/devices-shelly-ng/services/shelly-ws-server.service.js.map +1 -1
- package/dist/plugins/devices-shelly-v1/devices-shelly-v1.constants.d.ts +2 -0
- package/dist/plugins/devices-shelly-v1/devices-shelly-v1.constants.js +66 -4
- package/dist/plugins/devices-shelly-v1/devices-shelly-v1.constants.js.map +1 -1
- package/dist/plugins/devices-shelly-v1/devices-shelly-v1.plugin.js +2 -0
- package/dist/plugins/devices-shelly-v1/devices-shelly-v1.plugin.js.map +1 -1
- package/dist/plugins/devices-shelly-v1/platforms/shelly-v1.device.platform.js +7 -0
- package/dist/plugins/devices-shelly-v1/platforms/shelly-v1.device.platform.js.map +1 -1
- package/dist/plugins/devices-shelly-v1/services/device-mapper.service.d.ts +3 -1
- package/dist/plugins/devices-shelly-v1/services/device-mapper.service.js +20 -2
- package/dist/plugins/devices-shelly-v1/services/device-mapper.service.js.map +1 -1
- package/dist/plugins/devices-shelly-v1/services/shelly-v1-input-tracker.service.d.ts +16 -0
- package/dist/plugins/devices-shelly-v1/services/shelly-v1-input-tracker.service.js +107 -0
- package/dist/plugins/devices-shelly-v1/services/shelly-v1-input-tracker.service.js.map +1 -0
- package/dist/plugins/devices-shelly-v1/services/shelly-v1.service.d.ts +7 -1
- package/dist/plugins/devices-shelly-v1/services/shelly-v1.service.js +98 -3
- package/dist/plugins/devices-shelly-v1/services/shelly-v1.service.js.map +1 -1
- package/dist/plugins/devices-third-party/controllers/third-party-inputs.controller.d.ts +17 -0
- package/dist/plugins/devices-third-party/controllers/third-party-inputs.controller.js +205 -0
- package/dist/plugins/devices-third-party/controllers/third-party-inputs.controller.js.map +1 -0
- package/dist/plugins/devices-third-party/devices-third-party.openapi.d.ts +1 -1
- package/dist/plugins/devices-third-party/devices-third-party.plugin.js +2 -1
- package/dist/plugins/devices-third-party/devices-third-party.plugin.js.map +1 -1
- package/dist/plugins/devices-third-party/dto/report-input-occurrence-response.dto.d.ts +5 -0
- package/dist/plugins/devices-third-party/dto/report-input-occurrence-response.dto.js +50 -0
- package/dist/plugins/devices-third-party/dto/report-input-occurrence-response.dto.js.map +1 -0
- package/dist/plugins/devices-third-party/dto/report-input-occurrence.dto.d.ts +8 -0
- package/dist/plugins/devices-third-party/dto/report-input-occurrence.dto.js +81 -0
- package/dist/plugins/devices-third-party/dto/report-input-occurrence.dto.js.map +1 -0
- package/dist/plugins/devices-third-party/platforms/third-party-device.platform.js +19 -4
- package/dist/plugins/devices-third-party/platforms/third-party-device.platform.js.map +1 -1
- package/dist/plugins/devices-virtual/listeners/virtual-projection.listener.d.ts +2 -0
- package/dist/plugins/devices-virtual/listeners/virtual-projection.listener.js +57 -0
- package/dist/plugins/devices-virtual/listeners/virtual-projection.listener.js.map +1 -1
- package/dist/plugins/devices-virtual/platforms/virtual-device.platform.d.ts +3 -8
- package/dist/plugins/devices-virtual/platforms/virtual-device.platform.js +6 -31
- package/dist/plugins/devices-virtual/platforms/virtual-device.platform.js.map +1 -1
- package/dist/plugins/devices-wled/services/wled-mdns-discoverer.service.js +3 -1
- package/dist/plugins/devices-wled/services/wled-mdns-discoverer.service.js.map +1 -1
- package/dist/plugins/devices-zigbee2mqtt/devices-zigbee2mqtt.constants.d.ts +3 -0
- package/dist/plugins/devices-zigbee2mqtt/devices-zigbee2mqtt.constants.js +41 -5
- package/dist/plugins/devices-zigbee2mqtt/devices-zigbee2mqtt.constants.js.map +1 -1
- package/dist/plugins/devices-zigbee2mqtt/interfaces/zigbee2mqtt.interface.d.ts +7 -1
- package/dist/plugins/devices-zigbee2mqtt/mappings/config-driven.converter.js +16 -15
- package/dist/plugins/devices-zigbee2mqtt/mappings/config-driven.converter.js.map +1 -1
- package/dist/plugins/devices-zigbee2mqtt/mappings/definitions/remotes.yaml +505 -74
- package/dist/plugins/devices-zigbee2mqtt/mappings/schema/mapping-schema.json +3 -3
- package/dist/plugins/devices-zigbee2mqtt/mappings/transformers/transformer.types.d.ts +1 -1
- package/dist/plugins/devices-zigbee2mqtt/services/base-client-adapter.d.ts +8 -2
- package/dist/plugins/devices-zigbee2mqtt/services/base-client-adapter.js +6 -5
- package/dist/plugins/devices-zigbee2mqtt/services/base-client-adapter.js.map +1 -1
- package/dist/plugins/devices-zigbee2mqtt/services/device-adoption.service.js +18 -11
- package/dist/plugins/devices-zigbee2mqtt/services/device-adoption.service.js.map +1 -1
- package/dist/plugins/devices-zigbee2mqtt/services/device-mapper.service.d.ts +9 -3
- package/dist/plugins/devices-zigbee2mqtt/services/device-mapper.service.js +166 -3
- package/dist/plugins/devices-zigbee2mqtt/services/device-mapper.service.js.map +1 -1
- package/dist/plugins/devices-zigbee2mqtt/services/mqtt-client-adapter.service.js +5 -2
- package/dist/plugins/devices-zigbee2mqtt/services/mqtt-client-adapter.service.js.map +1 -1
- package/dist/plugins/devices-zigbee2mqtt/services/zigbee2mqtt.service.d.ts +1 -0
- package/dist/plugins/devices-zigbee2mqtt/services/zigbee2mqtt.service.js +44 -4
- package/dist/plugins/devices-zigbee2mqtt/services/zigbee2mqtt.service.js.map +1 -1
- package/dist/plugins/influx-v1/services/influx-v1-managed.service.js +2 -2
- package/dist/plugins/influx-v1/services/influx-v1-managed.service.js.map +1 -1
- package/dist/plugins/influx-v2/services/influx-v2-managed.service.js +2 -2
- package/dist/plugins/influx-v2/services/influx-v2-managed.service.js.map +1 -1
- package/dist/plugins/memory-storage/services/memory-storage-managed.service.js +2 -2
- package/dist/plugins/memory-storage/services/memory-storage-managed.service.js.map +1 -1
- package/dist/plugins/remote-access-cloudflare-tunnel/controllers/setup.controller.d.ts +19 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/controllers/setup.controller.js +159 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/controllers/setup.controller.js.map +1 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/controllers/status.controller.d.ts +13 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/controllers/status.controller.js +99 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/controllers/status.controller.js.map +1 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/dto/update-config.dto.d.ts +9 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/dto/update-config.dto.js +94 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/dto/update-config.dto.js.map +1 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/models/config.model.d.ts +9 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/models/config.model.js +92 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/models/config.model.js.map +1 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/models/install.model.d.ts +7 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/models/install.model.js +48 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/models/install.model.js.map +1 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/models/status.model.d.ts +44 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/models/status.model.js +369 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/models/status.model.js.map +1 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.constants.d.ts +24 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.constants.js +27 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.constants.js.map +1 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.exceptions.d.ts +8 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.exceptions.js +19 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.exceptions.js.map +1 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.openapi.d.ts +4 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.openapi.js +20 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.openapi.js.map +1 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.plugin.d.ts +21 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.plugin.js +135 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.plugin.js.map +1 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/scripts/cloudflared-setup.sh +185 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-managed.service.d.ts +100 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-managed.service.js +564 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-managed.service.js.map +1 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-provider.service.d.ts +22 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-provider.service.js +43 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-provider.service.js.map +1 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-setup.service.d.ts +38 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-setup.service.js +147 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-setup.service.js.map +1 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-cli.service.d.ts +15 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-cli.service.js +55 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-cli.service.js.map +1 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-metrics.service.d.ts +8 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-metrics.service.js +49 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-metrics.service.js.map +1 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-process.service.d.ts +27 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-process.service.js +139 -0
- package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-process.service.js.map +1 -0
- package/dist/plugins/remote-access-tailscale/controllers/setup.controller.d.ts +11 -6
- package/dist/plugins/remote-access-tailscale/controllers/setup.controller.js +115 -25
- package/dist/plugins/remote-access-tailscale/controllers/setup.controller.js.map +1 -1
- package/dist/plugins/remote-access-tailscale/controllers/status.controller.d.ts +6 -5
- package/dist/plugins/remote-access-tailscale/controllers/status.controller.js +26 -16
- package/dist/plugins/remote-access-tailscale/controllers/status.controller.js.map +1 -1
- package/dist/plugins/remote-access-tailscale/models/status.model.d.ts +16 -0
- package/dist/plugins/remote-access-tailscale/models/status.model.js +100 -1
- package/dist/plugins/remote-access-tailscale/models/status.model.js.map +1 -1
- package/dist/plugins/remote-access-tailscale/remote-access-tailscale.constants.d.ts +3 -0
- package/dist/plugins/remote-access-tailscale/remote-access-tailscale.constants.js +4 -1
- package/dist/plugins/remote-access-tailscale/remote-access-tailscale.constants.js.map +1 -1
- package/dist/plugins/remote-access-tailscale/remote-access-tailscale.exceptions.d.ts +17 -1
- package/dist/plugins/remote-access-tailscale/remote-access-tailscale.exceptions.js +33 -1
- package/dist/plugins/remote-access-tailscale/remote-access-tailscale.exceptions.js.map +1 -1
- package/dist/plugins/remote-access-tailscale/remote-access-tailscale.openapi.d.ts +2 -2
- package/dist/plugins/remote-access-tailscale/remote-access-tailscale.openapi.js +1 -0
- package/dist/plugins/remote-access-tailscale/remote-access-tailscale.openapi.js.map +1 -1
- package/dist/plugins/remote-access-tailscale/remote-access-tailscale.plugin.js +3 -1
- package/dist/plugins/remote-access-tailscale/remote-access-tailscale.plugin.js.map +1 -1
- package/dist/plugins/remote-access-tailscale/services/tailscale-cli.service.d.ts +8 -4
- package/dist/plugins/remote-access-tailscale/services/tailscale-cli.service.js +58 -14
- package/dist/plugins/remote-access-tailscale/services/tailscale-cli.service.js.map +1 -1
- package/dist/plugins/remote-access-tailscale/services/tailscale-login.service.d.ts +8 -3
- package/dist/plugins/remote-access-tailscale/services/tailscale-login.service.js +175 -151
- package/dist/plugins/remote-access-tailscale/services/tailscale-login.service.js.map +1 -1
- package/dist/plugins/remote-access-tailscale/services/tailscale-node-managed.service.d.ts +54 -7
- package/dist/plugins/remote-access-tailscale/services/tailscale-node-managed.service.js +528 -109
- package/dist/plugins/remote-access-tailscale/services/tailscale-node-managed.service.js.map +1 -1
- package/dist/plugins/remote-access-tailscale/services/tailscale-operation-coordinator.service.d.ts +33 -0
- package/dist/plugins/remote-access-tailscale/services/tailscale-operation-coordinator.service.js +167 -0
- package/dist/plugins/remote-access-tailscale/services/tailscale-operation-coordinator.service.js.map +1 -0
- package/dist/plugins/remote-access-tailscale/services/tailscale-provider.service.d.ts +13 -1
- package/dist/plugins/remote-access-tailscale/services/tailscale-provider.service.js +8 -2
- package/dist/plugins/remote-access-tailscale/services/tailscale-provider.service.js.map +1 -1
- package/dist/plugins/remote-access-tailscale/services/tailscale-serve.service.d.ts +1 -1
- package/dist/plugins/remote-access-tailscale/services/tailscale-serve.service.js +7 -6
- package/dist/plugins/remote-access-tailscale/services/tailscale-serve.service.js.map +1 -1
- package/dist/plugins/remote-access-tailscale/services/tailscale-setup.service.d.ts +1 -3
- package/dist/plugins/remote-access-tailscale/services/tailscale-setup.service.js +9 -11
- package/dist/plugins/remote-access-tailscale/services/tailscale-setup.service.js.map +1 -1
- package/dist/plugins/remote-access-tailscale/utils/tailscale-control.utils.d.ts +5 -0
- package/dist/plugins/remote-access-tailscale/utils/tailscale-control.utils.js +36 -0
- package/dist/plugins/remote-access-tailscale/utils/tailscale-control.utils.js.map +1 -0
- package/dist/plugins/scenes-local/platforms/local-scene.platform.d.ts +3 -1
- package/dist/plugins/scenes-local/platforms/local-scene.platform.js +12 -7
- package/dist/plugins/scenes-local/platforms/local-scene.platform.js.map +1 -1
- package/dist/plugins/simulator/controllers/simulator.controller.d.ts +8 -2
- package/dist/plugins/simulator/controllers/simulator.controller.js +102 -2
- package/dist/plugins/simulator/controllers/simulator.controller.js.map +1 -1
- package/dist/plugins/simulator/dto/simulate-occurrence.dto.d.ts +12 -0
- package/dist/plugins/simulator/dto/simulate-occurrence.dto.js +122 -0
- package/dist/plugins/simulator/dto/simulate-occurrence.dto.js.map +1 -0
- package/dist/plugins/simulator/models/simulator-response.model.d.ts +12 -0
- package/dist/plugins/simulator/models/simulator-response.model.js +84 -1
- package/dist/plugins/simulator/models/simulator-response.model.js.map +1 -1
- package/dist/plugins/simulator/scenarios/definitions/small-apartment.yaml +78 -0
- package/dist/plugins/simulator/services/scenario-executor.service.js +3 -1
- package/dist/plugins/simulator/services/scenario-executor.service.js.map +1 -1
- package/dist/plugins/simulator/services/simulation.service.js +10 -1
- package/dist/plugins/simulator/services/simulation.service.js.map +1 -1
- package/dist/plugins/simulator/simulator.openapi.d.ts +3 -2
- package/dist/plugins/simulator/simulator.openapi.js +5 -0
- package/dist/plugins/simulator/simulator.openapi.js.map +1 -1
- package/dist/plugins/simulator/simulators/device-simulator.interface.d.ts +2 -0
- package/dist/plugins/simulator/simulators/device-simulator.interface.js +83 -0
- package/dist/plugins/simulator/simulators/device-simulator.interface.js.map +1 -1
- package/dist/plugins/simulator/simulators/index.d.ts +1 -0
- package/dist/plugins/simulator/simulators/index.js +1 -0
- package/dist/plugins/simulator/simulators/index.js.map +1 -1
- package/dist/plugins/simulator/simulators/input-controller.simulator.d.ts +10 -0
- package/dist/plugins/simulator/simulators/input-controller.simulator.js +57 -0
- package/dist/plugins/simulator/simulators/input-controller.simulator.js.map +1 -0
- package/dist/plugins/simulator/simulators/lighting.simulator.js +1 -0
- package/dist/plugins/simulator/simulators/lighting.simulator.js.map +1 -1
- package/dist/plugins/spaces-home-control/listeners/space-activity.listener.d.ts +6 -7
- package/dist/plugins/spaces-home-control/listeners/space-activity.listener.js +19 -44
- package/dist/plugins/spaces-home-control/listeners/space-activity.listener.js.map +1 -1
- package/dist/plugins/spaces-home-control/listeners/space-climate-state.listener.d.ts +4 -4
- package/dist/plugins/spaces-home-control/listeners/space-climate-state.listener.js +9 -22
- package/dist/plugins/spaces-home-control/listeners/space-climate-state.listener.js.map +1 -1
- package/dist/plugins/spaces-home-control/listeners/space-lighting-state.listener.d.ts +4 -4
- package/dist/plugins/spaces-home-control/listeners/space-lighting-state.listener.js +9 -22
- package/dist/plugins/spaces-home-control/listeners/space-lighting-state.listener.js.map +1 -1
- package/dist/plugins/spaces-home-control/listeners/space-sensor-state.listener.d.ts +4 -4
- package/dist/plugins/spaces-home-control/listeners/space-sensor-state.listener.js +9 -22
- package/dist/plugins/spaces-home-control/listeners/space-sensor-state.listener.js.map +1 -1
- package/dist/plugins/spaces-home-control/services/climate-intent.service.d.ts +3 -1
- package/dist/plugins/spaces-home-control/services/climate-intent.service.js +6 -3
- package/dist/plugins/spaces-home-control/services/climate-intent.service.js.map +1 -1
- package/dist/plugins/spaces-home-control/services/covers-intent.service.d.ts +3 -1
- package/dist/plugins/spaces-home-control/services/covers-intent.service.js +6 -3
- package/dist/plugins/spaces-home-control/services/covers-intent.service.js.map +1 -1
- package/dist/plugins/spaces-home-control/services/lighting-intent.service.d.ts +3 -1
- package/dist/plugins/spaces-home-control/services/lighting-intent.service.js +7 -4
- package/dist/plugins/spaces-home-control/services/lighting-intent.service.js.map +1 -1
- package/dist/plugins/spaces-home-control/services/space-climate-state.service.d.ts +3 -5
- package/dist/plugins/spaces-home-control/services/space-climate-state.service.js +9 -12
- package/dist/plugins/spaces-home-control/services/space-climate-state.service.js.map +1 -1
- package/dist/plugins/spaces-home-control/services/space-lighting-state.service.d.ts +3 -5
- package/dist/plugins/spaces-home-control/services/space-lighting-state.service.js +7 -10
- package/dist/plugins/spaces-home-control/services/space-lighting-state.service.js.map +1 -1
- package/dist/plugins/spaces-home-control/services/space-media-activity.service.d.ts +3 -1
- package/dist/plugins/spaces-home-control/services/space-media-activity.service.js +11 -5
- package/dist/plugins/spaces-home-control/services/space-media-activity.service.js.map +1 -1
- package/dist/plugins/spaces-home-control/services/space-sensor-state.service.d.ts +3 -5
- package/dist/plugins/spaces-home-control/services/space-sensor-state.service.js +7 -10
- package/dist/plugins/spaces-home-control/services/space-sensor-state.service.js.map +1 -1
- package/dist/plugins/spaces-home-control/services/space-state-read.service.d.ts +47 -0
- package/dist/plugins/spaces-home-control/services/space-state-read.service.js +262 -0
- package/dist/plugins/spaces-home-control/services/space-state-read.service.js.map +1 -0
- package/dist/plugins/spaces-home-control/services/space-undo-history.service.d.ts +3 -1
- package/dist/plugins/spaces-home-control/services/space-undo-history.service.js +8 -5
- package/dist/plugins/spaces-home-control/services/space-undo-history.service.js.map +1 -1
- package/dist/plugins/spaces-home-control/spaces-home-control.plugin.js +4 -0
- package/dist/plugins/spaces-home-control/spaces-home-control.plugin.js.map +1 -1
- package/dist/spec/channels.d.ts +51 -1
- package/dist/spec/channels.js +64 -1
- package/dist/spec/channels.js.map +1 -1
- package/dist/spec/devices.d.ts +155 -2
- package/dist/spec/devices.js +161 -2
- package/dist/spec/devices.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DeviceCategory } from '../../../modules/devices/devices.constants';
|
|
2
|
+
import { SimulatorDeviceEntity } from '../entities/simulator.entity';
|
|
3
|
+
import { BaseDeviceSimulator, SimulatedPropertyValue } from './device-simulator.interface';
|
|
4
|
+
import { SimulationContext } from './simulation-context';
|
|
5
|
+
export declare class InputControllerSimulator extends BaseDeviceSimulator {
|
|
6
|
+
private rawBatteryValues;
|
|
7
|
+
getSupportedCategory(): DeviceCategory;
|
|
8
|
+
simulate(device: SimulatorDeviceEntity, context: SimulationContext, previousValues?: Map<string, string | number | boolean>): SimulatedPropertyValue[];
|
|
9
|
+
private simulateBattery;
|
|
10
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InputControllerSimulator = void 0;
|
|
4
|
+
const devices_constants_1 = require("../../../modules/devices/devices.constants");
|
|
5
|
+
const device_simulator_interface_1 = require("./device-simulator.interface");
|
|
6
|
+
class InputControllerSimulator extends device_simulator_interface_1.BaseDeviceSimulator {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.rawBatteryValues = new Map();
|
|
10
|
+
}
|
|
11
|
+
getSupportedCategory() {
|
|
12
|
+
return devices_constants_1.DeviceCategory.INPUT_CONTROLLER;
|
|
13
|
+
}
|
|
14
|
+
simulate(device, context, previousValues) {
|
|
15
|
+
const values = [];
|
|
16
|
+
values.push(...this.simulateInputChannels(device, context, previousValues));
|
|
17
|
+
if (this.hasChannel(device, devices_constants_1.ChannelCategory.BATTERY)) {
|
|
18
|
+
values.push(...this.simulateBattery(device.id, previousValues));
|
|
19
|
+
}
|
|
20
|
+
return values;
|
|
21
|
+
}
|
|
22
|
+
simulateBattery(deviceId, previousValues) {
|
|
23
|
+
let rawBattery = this.rawBatteryValues.get(deviceId);
|
|
24
|
+
if (rawBattery === undefined) {
|
|
25
|
+
rawBattery = this.getPreviousValue(previousValues, devices_constants_1.ChannelCategory.BATTERY, devices_constants_1.PropertyCategory.PERCENTAGE, 100);
|
|
26
|
+
}
|
|
27
|
+
const decrease = Math.random() * 0.02 + 0.005;
|
|
28
|
+
rawBattery -= decrease;
|
|
29
|
+
if (rawBattery < 10) {
|
|
30
|
+
rawBattery = 100;
|
|
31
|
+
}
|
|
32
|
+
this.rawBatteryValues.set(deviceId, rawBattery);
|
|
33
|
+
const rounded = Math.round(rawBattery);
|
|
34
|
+
const values = [
|
|
35
|
+
{
|
|
36
|
+
channelCategory: devices_constants_1.ChannelCategory.BATTERY,
|
|
37
|
+
propertyCategory: devices_constants_1.PropertyCategory.PERCENTAGE,
|
|
38
|
+
value: rounded,
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
let status = 'normal';
|
|
42
|
+
if (rounded <= 15) {
|
|
43
|
+
status = 'critical';
|
|
44
|
+
}
|
|
45
|
+
else if (rounded <= 25) {
|
|
46
|
+
status = 'low';
|
|
47
|
+
}
|
|
48
|
+
values.push({
|
|
49
|
+
channelCategory: devices_constants_1.ChannelCategory.BATTERY,
|
|
50
|
+
propertyCategory: devices_constants_1.PropertyCategory.STATUS,
|
|
51
|
+
value: status,
|
|
52
|
+
});
|
|
53
|
+
return values;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.InputControllerSimulator = InputControllerSimulator;
|
|
57
|
+
//# sourceMappingURL=input-controller.simulator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-controller.simulator.js","sourceRoot":"","sources":["../../../../src/plugins/simulator/simulators/input-controller.simulator.ts"],"names":[],"mappings":";;;AAAA,kFAA+G;AAG/G,6EAA2F;AAO3F,MAAa,wBAAyB,SAAQ,gDAAmB;IAAjE;;QACS,qBAAgB,GAAwB,IAAI,GAAG,EAAE,CAAC;IAwE3D,CAAC;IAtEA,oBAAoB;QACnB,OAAO,kCAAc,CAAC,gBAAgB,CAAC;IACxC,CAAC;IAED,QAAQ,CACP,MAA6B,EAC7B,OAA0B,EAC1B,cAAuD;QAEvD,MAAM,MAAM,GAA6B,EAAE,CAAC;QAE5C,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,MAAM,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC;QAE5E,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,mCAAe,CAAC,OAAO,CAAC,EAAE,CAAC;YACtD,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC;QACjE,CAAC;QAED,OAAO,MAAM,CAAC;IACf,CAAC;IAKO,eAAe,CACtB,QAAgB,EAChB,cAAuD;QAEvD,IAAI,UAAU,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACrD,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC9B,UAAU,GAAG,IAAI,CAAC,gBAAgB,CACjC,cAAc,EACd,mCAAe,CAAC,OAAO,EACvB,oCAAgB,CAAC,UAAU,EAC3B,GAAG,CACO,CAAC;QACb,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,GAAG,KAAK,CAAC;QAC9C,UAAU,IAAI,QAAQ,CAAC;QAEvB,IAAI,UAAU,GAAG,EAAE,EAAE,CAAC;YACrB,UAAU,GAAG,GAAG,CAAC;QAClB,CAAC;QAED,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QAEhD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACvC,MAAM,MAAM,GAA6B;YACxC;gBACC,eAAe,EAAE,mCAAe,CAAC,OAAO;gBACxC,gBAAgB,EAAE,oCAAgB,CAAC,UAAU;gBAC7C,KAAK,EAAE,OAAO;aACd;SACD,CAAC;QAEF,IAAI,MAAM,GAAG,QAAQ,CAAC;QACtB,IAAI,OAAO,IAAI,EAAE,EAAE,CAAC;YACnB,MAAM,GAAG,UAAU,CAAC;QACrB,CAAC;aAAM,IAAI,OAAO,IAAI,EAAE,EAAE,CAAC;YAC1B,MAAM,GAAG,KAAK,CAAC;QAChB,CAAC;QAED,MAAM,CAAC,IAAI,CAAC;YACX,eAAe,EAAE,mCAAe,CAAC,OAAO;YACxC,gBAAgB,EAAE,oCAAgB,CAAC,MAAM;YACzC,KAAK,EAAE,MAAM;SACb,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC;IACf,CAAC;CACD;AAzED,4DAyEC"}
|
|
@@ -12,6 +12,7 @@ class LightingSimulator extends device_simulator_interface_1.BaseDeviceSimulator
|
|
|
12
12
|
if (this.hasChannel(device, devices_constants_1.ChannelCategory.LIGHT)) {
|
|
13
13
|
values.push(...this.simulateLight(device, context, previousValues));
|
|
14
14
|
}
|
|
15
|
+
values.push(...this.simulateInputChannels(device, context, previousValues));
|
|
15
16
|
return values;
|
|
16
17
|
}
|
|
17
18
|
simulateLight(device, context, previousValues) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lighting.simulator.js","sourceRoot":"","sources":["../../../../src/plugins/simulator/simulators/lighting.simulator.ts"],"names":[],"mappings":";;;AAAA,kFAA+G;AAG/G,6EAA2F;AAO3F,MAAa,iBAAkB,SAAQ,gDAAmB;IACzD,oBAAoB;QACnB,OAAO,kCAAc,CAAC,QAAQ,CAAC;IAChC,CAAC;IAED,QAAQ,CACP,MAA6B,EAC7B,OAA0B,EAC1B,cAAuD;QAEvD,MAAM,MAAM,GAA6B,EAAE,CAAC;QAE5C,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,mCAAe,CAAC,KAAK,CAAC,EAAE,CAAC;YACpD,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC;QACrE,CAAC;QAED,OAAO,MAAM,CAAC;IACf,CAAC;IAKO,aAAa,CACpB,MAA6B,EAC7B,OAA0B,EAC1B,cAAuD;QAEvD,MAAM,MAAM,GAA6B,EAAE,CAAC;QAG5C,MAAM,IAAI,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QAC3C,MAAM,CAAC,IAAI,CAAC;YACX,eAAe,EAAE,mCAAe,CAAC,KAAK;YACtC,gBAAgB,EAAE,oCAAgB,CAAC,EAAE;YACrC,KAAK,EAAE,IAAI;SACX,CAAC,CAAC;QAEH,IAAI,CAAC,IAAI,EAAE,CAAC;YACX,OAAO,MAAM,CAAC;QACf,CAAC;QAGD,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,mCAAe,CAAC,KAAK,EAAE,oCAAgB,CA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,CAAC;QAC/B,CAAC;QAGD,IAAI,IAAI,IAAI,EAAE,EAAE,CAAC;YAChB,KAAK,GAAG,IAAI,CAAC;YACb,KAAK,GAAG,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,cAAc,CAAC;QAC1D,CAAC;aAAM,CAAC;YACP,KAAK,GAAG,IAAI,GAAG,EAAE,CAAC;YAClB,KAAK,GAAG,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,YAAY,CAAC,CAAC;QACzD,CAAC;QACD,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;QAGlC,IAAI,IAAI,IAAI,EAAE,EAAE,CAAC;YAChB,IAAI,GAAG,GAAG,CAAC;QACZ,CAAC;aAAM,IAAI,IAAI,IAAI,EAAE,EAAE,CAAC;YACvB,IAAI,GAAG,CAAC,CAAC;QACV,CAAC;aAAM,CAAC;YACP,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;YACjB,IAAI,GAAG,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC;YACxD,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;QACjC,CAAC;QAED,OAAO;YACN,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;YACpB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;YACxB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;SACtB,CAAC;IACH,CAAC;CACD;AAzRD,8CAyRC"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { Repository } from 'typeorm';
|
|
2
1
|
import { OnModuleInit } from '@nestjs/common';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { ChannelPropertyEntity } from '../../../modules/devices/entities/devices.entity';
|
|
3
|
+
import { PropertyMetadataService } from '../../../modules/devices/services/property-metadata.service';
|
|
4
|
+
import { SpaceActivityService } from '../../../modules/spaces/services/space-activity.service';
|
|
5
5
|
export declare class SpaceActivityListener implements OnModuleInit {
|
|
6
|
-
private readonly
|
|
7
|
-
private readonly
|
|
6
|
+
private readonly propertyMetadata;
|
|
7
|
+
private readonly activity;
|
|
8
8
|
private readonly logger;
|
|
9
|
-
constructor(
|
|
9
|
+
constructor(propertyMetadata: PropertyMetadataService, activity: SpaceActivityService);
|
|
10
10
|
onModuleInit(): void;
|
|
11
11
|
handlePropertyUpdated(property: ChannelPropertyEntity): Promise<void>;
|
|
12
|
-
private updateSpaceActivity;
|
|
13
12
|
}
|
|
@@ -8,68 +8,45 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
12
|
exports.SpaceActivityListener = void 0;
|
|
16
|
-
const typeorm_1 = require("typeorm");
|
|
17
13
|
const common_1 = require("@nestjs/common");
|
|
18
14
|
const event_emitter_1 = require("@nestjs/event-emitter");
|
|
19
|
-
const typeorm_2 = require("@nestjs/typeorm");
|
|
20
15
|
const logger_1 = require("../../../common/logger");
|
|
21
16
|
const devices_constants_1 = require("../../../modules/devices/devices.constants");
|
|
22
17
|
const devices_entity_1 = require("../../../modules/devices/entities/devices.entity");
|
|
23
|
-
const
|
|
18
|
+
const property_metadata_service_1 = require("../../../modules/devices/services/property-metadata.service");
|
|
19
|
+
const space_activity_service_1 = require("../../../modules/spaces/services/space-activity.service");
|
|
24
20
|
const spaces_constants_1 = require("../../../modules/spaces/spaces.constants");
|
|
25
21
|
let SpaceActivityListener = class SpaceActivityListener {
|
|
26
|
-
constructor(
|
|
27
|
-
this.
|
|
28
|
-
this.
|
|
22
|
+
constructor(propertyMetadata, activity) {
|
|
23
|
+
this.propertyMetadata = propertyMetadata;
|
|
24
|
+
this.activity = activity;
|
|
29
25
|
this.logger = (0, logger_1.createExtensionLogger)(spaces_constants_1.SPACES_MODULE_NAME, 'SpaceActivityListener');
|
|
30
26
|
}
|
|
31
27
|
onModuleInit() {
|
|
32
28
|
this.logger.debug('Space activity listener initialized');
|
|
33
29
|
}
|
|
34
30
|
async handlePropertyUpdated(property) {
|
|
31
|
+
const observedAt = new Date();
|
|
32
|
+
const generation = this.activity.getGeneration();
|
|
35
33
|
try {
|
|
36
|
-
|
|
34
|
+
if (!property.id)
|
|
35
|
+
return;
|
|
36
|
+
const metadata = await this.propertyMetadata.findOne(property.id);
|
|
37
|
+
const channel = metadata?.channel;
|
|
38
|
+
if (!channel || typeof channel === 'string')
|
|
39
|
+
return;
|
|
40
|
+
const device = channel.device;
|
|
41
|
+
if (!device || typeof device === 'string' || !device.roomId)
|
|
42
|
+
return;
|
|
43
|
+
this.activity.record(device.roomId, observedAt, generation);
|
|
37
44
|
}
|
|
38
45
|
catch (error) {
|
|
39
46
|
const err = error;
|
|
40
47
|
this.logger.warn(`Failed to update space activity on property update: ${err.message}`, err.stack);
|
|
41
48
|
}
|
|
42
49
|
}
|
|
43
|
-
async updateSpaceActivity(property) {
|
|
44
|
-
const channelId = typeof property.channel === 'string' ? property.channel : property.channel?.id;
|
|
45
|
-
if (!channelId) {
|
|
46
|
-
this.logger.debug('Property has no channel, skipping activity update');
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
const channel = await this.channelRepository
|
|
50
|
-
.createQueryBuilder('channel')
|
|
51
|
-
.innerJoinAndSelect('channel.device', 'device')
|
|
52
|
-
.where('channel.id = :channelId', { channelId })
|
|
53
|
-
.andWhere('device.roomId IS NOT NULL')
|
|
54
|
-
.getOne();
|
|
55
|
-
if (!channel) {
|
|
56
|
-
this.logger.debug('Channel not found or device has no room, skipping activity update');
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
const device = channel.device;
|
|
60
|
-
if (!device.roomId) {
|
|
61
|
-
this.logger.debug('Device has no room, skipping activity update');
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
const now = new Date();
|
|
65
|
-
await this.spaceRepository
|
|
66
|
-
.createQueryBuilder()
|
|
67
|
-
.update()
|
|
68
|
-
.set({ lastActivityAt: now })
|
|
69
|
-
.where('id = :roomId', { roomId: device.roomId })
|
|
70
|
-
.execute();
|
|
71
|
-
this.logger.debug(`Updated lastActivityAt for room=${device.roomId} to ${now.toISOString()}`);
|
|
72
|
-
}
|
|
73
50
|
};
|
|
74
51
|
exports.SpaceActivityListener = SpaceActivityListener;
|
|
75
52
|
__decorate([
|
|
@@ -81,9 +58,7 @@ __decorate([
|
|
|
81
58
|
], SpaceActivityListener.prototype, "handlePropertyUpdated", null);
|
|
82
59
|
exports.SpaceActivityListener = SpaceActivityListener = __decorate([
|
|
83
60
|
(0, common_1.Injectable)(),
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
__metadata("design:paramtypes", [typeorm_1.Repository,
|
|
87
|
-
typeorm_1.Repository])
|
|
61
|
+
__metadata("design:paramtypes", [property_metadata_service_1.PropertyMetadataService,
|
|
62
|
+
space_activity_service_1.SpaceActivityService])
|
|
88
63
|
], SpaceActivityListener);
|
|
89
64
|
//# sourceMappingURL=space-activity.listener.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"space-activity.listener.js","sourceRoot":"","sources":["../../../../src/plugins/spaces-home-control/listeners/space-activity.listener.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"space-activity.listener.js","sourceRoot":"","sources":["../../../../src/plugins/spaces-home-control/listeners/space-activity.listener.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA0D;AAC1D,yDAAgD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I,CAAC,uDAAuD,GAAG,CAAC,OAAO,EAAE,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;QACnG,CAAC;IACF,CAAC;CACD,CAAA;AAhCY,sDAAqB;AAc3B;IAFL,IAAA,uBAAO,EAAC,6BAAgB,CAAC,wBAAwB,CAAC;IAClD,IAAA,uBAAO,EAAC,6BAAgB,CAAC,0BAA0B,CAAC;;qCACf,sCAAqB;;kEAiB1D;gCA/BW,qBAAqB;IADjC,IAAA,mBAAU,GAAE;qCAKwB,mDAAuB;QAC/B,6CAAoB;GALpC,qBAAqB,CAgCjC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Repository } from 'typeorm';
|
|
2
1
|
import { OnModuleDestroy, OnModuleInit } from '@nestjs/common';
|
|
3
2
|
import { EventEmitter2 } from '@nestjs/event-emitter';
|
|
4
|
-
import {
|
|
3
|
+
import { ChannelPropertyEntity } from '../../../modules/devices/entities/devices.entity';
|
|
4
|
+
import { PropertyMetadataService } from '../../../modules/devices/services/property-metadata.service';
|
|
5
5
|
import { SpaceClimateStateService } from '../services/space-climate-state.service';
|
|
6
6
|
export declare class SpaceClimateStateListener implements OnModuleInit, OnModuleDestroy {
|
|
7
|
-
private readonly
|
|
7
|
+
private readonly propertyMetadata;
|
|
8
8
|
private readonly climateStateService;
|
|
9
9
|
private readonly eventEmitter;
|
|
10
10
|
private readonly logger;
|
|
11
11
|
private readonly debounceTimers;
|
|
12
|
-
constructor(
|
|
12
|
+
constructor(propertyMetadata: PropertyMetadataService, climateStateService: SpaceClimateStateService, eventEmitter: EventEmitter2);
|
|
13
13
|
onModuleInit(): void;
|
|
14
14
|
onModuleDestroy(): void;
|
|
15
15
|
handlePropertyChanged(property: ChannelPropertyEntity): Promise<void>;
|
|
@@ -8,20 +8,16 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
12
|
exports.SpaceClimateStateListener = void 0;
|
|
16
|
-
const typeorm_1 = require("typeorm");
|
|
17
13
|
const common_1 = require("@nestjs/common");
|
|
18
14
|
const event_emitter_1 = require("@nestjs/event-emitter");
|
|
19
|
-
const typeorm_2 = require("@nestjs/typeorm");
|
|
20
15
|
const logger_1 = require("../../../common/logger");
|
|
21
16
|
const transform_utils_1 = require("../../../common/utils/transform.utils");
|
|
22
17
|
const devices_constants_1 = require("../../../modules/devices/devices.constants");
|
|
23
18
|
const devices_constants_2 = require("../../../modules/devices/devices.constants");
|
|
24
19
|
const devices_entity_1 = require("../../../modules/devices/entities/devices.entity");
|
|
20
|
+
const property_metadata_service_1 = require("../../../modules/devices/services/property-metadata.service");
|
|
25
21
|
const spaces_constants_1 = require("../../../modules/spaces/spaces.constants");
|
|
26
22
|
const spaces_response_model_1 = require("../models/spaces-response.model");
|
|
27
23
|
const space_climate_state_service_1 = require("../services/space-climate-state.service");
|
|
@@ -42,8 +38,8 @@ const CLIMATE_PROPERTY_CATEGORIES = [
|
|
|
42
38
|
devices_constants_1.PropertyCategory.LOCKED,
|
|
43
39
|
];
|
|
44
40
|
let SpaceClimateStateListener = class SpaceClimateStateListener {
|
|
45
|
-
constructor(
|
|
46
|
-
this.
|
|
41
|
+
constructor(propertyMetadata, climateStateService, eventEmitter) {
|
|
42
|
+
this.propertyMetadata = propertyMetadata;
|
|
47
43
|
this.climateStateService = climateStateService;
|
|
48
44
|
this.eventEmitter = eventEmitter;
|
|
49
45
|
this.logger = (0, logger_1.createExtensionLogger)(spaces_constants_1.SPACES_MODULE_NAME, 'SpaceClimateStateListener');
|
|
@@ -68,27 +64,19 @@ let SpaceClimateStateListener = class SpaceClimateStateListener {
|
|
|
68
64
|
}
|
|
69
65
|
}
|
|
70
66
|
async processClimatePropertyChange(property) {
|
|
71
|
-
if (!CLIMATE_PROPERTY_CATEGORIES.includes(property.category)) {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
const channelId = typeof property.channel === 'string' ? property.channel : property.channel?.id;
|
|
75
|
-
if (!channelId) {
|
|
67
|
+
if (!property.id || !CLIMATE_PROPERTY_CATEGORIES.includes(property.category)) {
|
|
76
68
|
return;
|
|
77
69
|
}
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
.where('channel.id = :channelId', { channelId })
|
|
82
|
-
.andWhere('device.roomId IS NOT NULL')
|
|
83
|
-
.getOne();
|
|
84
|
-
if (!channel) {
|
|
70
|
+
const metadata = await this.propertyMetadata.findOne(property.id);
|
|
71
|
+
const channel = metadata?.channel;
|
|
72
|
+
if (!channel || typeof channel === 'string') {
|
|
85
73
|
return;
|
|
86
74
|
}
|
|
87
75
|
if (!CLIMATE_CHANNEL_CATEGORIES.includes(channel.category)) {
|
|
88
76
|
return;
|
|
89
77
|
}
|
|
90
78
|
const device = channel.device;
|
|
91
|
-
const roomId = device.roomId;
|
|
79
|
+
const roomId = device && typeof device !== 'string' ? device.roomId : null;
|
|
92
80
|
if (!roomId) {
|
|
93
81
|
return;
|
|
94
82
|
}
|
|
@@ -135,8 +123,7 @@ __decorate([
|
|
|
135
123
|
], SpaceClimateStateListener.prototype, "handlePropertyChanged", null);
|
|
136
124
|
exports.SpaceClimateStateListener = SpaceClimateStateListener = __decorate([
|
|
137
125
|
(0, common_1.Injectable)(),
|
|
138
|
-
|
|
139
|
-
__metadata("design:paramtypes", [typeorm_1.Repository,
|
|
126
|
+
__metadata("design:paramtypes", [property_metadata_service_1.PropertyMetadataService,
|
|
140
127
|
space_climate_state_service_1.SpaceClimateStateService,
|
|
141
128
|
event_emitter_1.EventEmitter2])
|
|
142
129
|
], SpaceClimateStateListener);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"space-climate-state.listener.js","sourceRoot":"","sources":["../../../../src/plugins/spaces-home-control/listeners/space-climate-state.listener.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"space-climate-state.listener.js","sourceRoot":"","sources":["../../../../src/plugins/spaces-home-control/listeners/space-climate-state.listener.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA2E;AAC3E,yDAA+D;AAE/D,mDAA+D;AAC/D,2EAAmE;AACnE,kFAA+F;AAC/F,kFAA2F;AAC3F,qFAAyF;AACzF,2GAAsG;AACtG,+EAA8E;AAC9E,2EAAwE;AACxE,yFAAmF;AACnF,oFAA6D;AAM7D,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAGtC,MAAM,0BAA0B,GAAsB;IACrD,mCAAe,CAAC,WAAW;IAC3B,mCAAe,CAAC,QAAQ;IACxB,mCAAe,CAAC,MAAM;IACtB,mCAAe,CAAC,MAAM;IACtB,mCAAe,CAAC,UAAU;CAC1B,CAAC;AAGF,MAAM,2BAA2B,GAAuB;IACvD,oCAAgB,CAAC,WAAW;IAC5B,oCAAgB,CAAC,EAAE;IACnB,oCAAgB,CAAC,MAAM;IACvB,oCAAgB,CAAC,QAAQ;IACzB,oCAAgB,CAAC,MAAM;CACvB,CAAC;AAGK,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IASrC,YACkB,gBAAyC,EACzC,mBAA6C,EAC7C,YAA2B;QAF3B,qBAAgB,GAAhB,gBAAgB,CAAyB;QACzC,wBAAmB,GAAnB,mBAAmB,CAA0B;QAC7C,iBAAY,GAAZ,YAAY,CAAe;QAX5B,WAAM,GAAG,IAAA,8BAAqB,EAAC,qCAAkB,EAAE,2BAA2B,CAAC,CAAC;QAMhF,mBAAc,GAAG,IAAI,GAAG,EAA0B,CAAC;IAMjE,CAAC;IAEJ,YAAY;QACX,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC/D,CAAC;IA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,KAAK,EAAE,CAAC;YAChB,MAAM,GAAG,GAAG,KAAc,CAAC;YAC3B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gDAAgD,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QAC5F,CAAC;IACF,CAAC;CACD,CAAA;AAxHY,8DAAyB;AA6B/B;IAFL,IAAA,uBAAO,EAAC,6BAAgB,CAAC,0BAA0B,CAAC;IACpD,IAAA,uBAAO,EAAC,6BAAgB,CAAC,wBAAwB,CAAC;;qCACb,sCAAqB;;sEAO1D;oCApCW,yBAAyB;IADrC,IAAA,mBAAU,GAAE;qCAWwB,mDAAuB;QACpB,sDAAwB;QAC/B,6BAAa;GAZjC,yBAAyB,CAwHrC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Repository } from 'typeorm';
|
|
2
1
|
import { OnModuleDestroy, OnModuleInit } from '@nestjs/common';
|
|
3
2
|
import { EventEmitter2 } from '@nestjs/event-emitter';
|
|
4
|
-
import {
|
|
3
|
+
import { ChannelPropertyEntity } from '../../../modules/devices/entities/devices.entity';
|
|
4
|
+
import { PropertyMetadataService } from '../../../modules/devices/services/property-metadata.service';
|
|
5
5
|
import { SpaceLightingStateService } from '../services/space-lighting-state.service';
|
|
6
6
|
export declare class SpaceLightingStateListener implements OnModuleInit, OnModuleDestroy {
|
|
7
|
-
private readonly
|
|
7
|
+
private readonly propertyMetadata;
|
|
8
8
|
private readonly lightingStateService;
|
|
9
9
|
private readonly eventEmitter;
|
|
10
10
|
private readonly logger;
|
|
11
11
|
private readonly debounceTimers;
|
|
12
|
-
constructor(
|
|
12
|
+
constructor(propertyMetadata: PropertyMetadataService, lightingStateService: SpaceLightingStateService, eventEmitter: EventEmitter2);
|
|
13
13
|
onModuleInit(): void;
|
|
14
14
|
onModuleDestroy(): void;
|
|
15
15
|
handlePropertyChanged(property: ChannelPropertyEntity): Promise<void>;
|
|
@@ -8,19 +8,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
12
|
exports.SpaceLightingStateListener = void 0;
|
|
16
|
-
const typeorm_1 = require("typeorm");
|
|
17
13
|
const common_1 = require("@nestjs/common");
|
|
18
14
|
const event_emitter_1 = require("@nestjs/event-emitter");
|
|
19
|
-
const typeorm_2 = require("@nestjs/typeorm");
|
|
20
15
|
const logger_1 = require("../../../common/logger");
|
|
21
16
|
const devices_constants_1 = require("../../../modules/devices/devices.constants");
|
|
22
17
|
const devices_constants_2 = require("../../../modules/devices/devices.constants");
|
|
23
18
|
const devices_entity_1 = require("../../../modules/devices/entities/devices.entity");
|
|
19
|
+
const property_metadata_service_1 = require("../../../modules/devices/services/property-metadata.service");
|
|
24
20
|
const spaces_constants_1 = require("../../../modules/spaces/spaces.constants");
|
|
25
21
|
const spaces_response_model_1 = require("../models/spaces-response.model");
|
|
26
22
|
const space_lighting_state_service_1 = require("../services/space-lighting-state.service");
|
|
@@ -39,8 +35,8 @@ const LIGHTING_PROPERTY_CATEGORIES = [
|
|
|
39
35
|
devices_constants_1.PropertyCategory.SATURATION,
|
|
40
36
|
];
|
|
41
37
|
let SpaceLightingStateListener = class SpaceLightingStateListener {
|
|
42
|
-
constructor(
|
|
43
|
-
this.
|
|
38
|
+
constructor(propertyMetadata, lightingStateService, eventEmitter) {
|
|
39
|
+
this.propertyMetadata = propertyMetadata;
|
|
44
40
|
this.lightingStateService = lightingStateService;
|
|
45
41
|
this.eventEmitter = eventEmitter;
|
|
46
42
|
this.logger = (0, logger_1.createExtensionLogger)(spaces_constants_1.SPACES_MODULE_NAME, 'SpaceLightingStateListener');
|
|
@@ -65,27 +61,19 @@ let SpaceLightingStateListener = class SpaceLightingStateListener {
|
|
|
65
61
|
}
|
|
66
62
|
}
|
|
67
63
|
async processLightingPropertyChange(property) {
|
|
68
|
-
if (!LIGHTING_PROPERTY_CATEGORIES.includes(property.category)) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
const channelId = typeof property.channel === 'string' ? property.channel : property.channel?.id;
|
|
72
|
-
if (!channelId) {
|
|
64
|
+
if (!property.id || !LIGHTING_PROPERTY_CATEGORIES.includes(property.category)) {
|
|
73
65
|
return;
|
|
74
66
|
}
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
.where('channel.id = :channelId', { channelId })
|
|
79
|
-
.andWhere('device.roomId IS NOT NULL')
|
|
80
|
-
.getOne();
|
|
81
|
-
if (!channel) {
|
|
67
|
+
const metadata = await this.propertyMetadata.findOne(property.id);
|
|
68
|
+
const channel = metadata?.channel;
|
|
69
|
+
if (!channel || typeof channel === 'string') {
|
|
82
70
|
return;
|
|
83
71
|
}
|
|
84
72
|
if (!LIGHTING_CHANNEL_CATEGORIES.includes(channel.category)) {
|
|
85
73
|
return;
|
|
86
74
|
}
|
|
87
75
|
const device = channel.device;
|
|
88
|
-
const roomId = device.roomId;
|
|
76
|
+
const roomId = device && typeof device !== 'string' ? device.roomId : null;
|
|
89
77
|
if (!roomId) {
|
|
90
78
|
return;
|
|
91
79
|
}
|
|
@@ -134,8 +122,7 @@ __decorate([
|
|
|
134
122
|
], SpaceLightingStateListener.prototype, "handlePropertyChanged", null);
|
|
135
123
|
exports.SpaceLightingStateListener = SpaceLightingStateListener = __decorate([
|
|
136
124
|
(0, common_1.Injectable)(),
|
|
137
|
-
|
|
138
|
-
__metadata("design:paramtypes", [typeorm_1.Repository,
|
|
125
|
+
__metadata("design:paramtypes", [property_metadata_service_1.PropertyMetadataService,
|
|
139
126
|
space_lighting_state_service_1.SpaceLightingStateService,
|
|
140
127
|
event_emitter_1.EventEmitter2])
|
|
141
128
|
], SpaceLightingStateListener);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"space-lighting-state.listener.js","sourceRoot":"","sources":["../../../../src/plugins/spaces-home-control/listeners/space-lighting-state.listener.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"space-lighting-state.listener.js","sourceRoot":"","sources":["../../../../src/plugins/spaces-home-control/listeners/space-lighting-state.listener.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA2E;AAC3E,yDAA+D;AAE/D,mDAA+D;AAC/D,kFAA+F;AAC/F,kFAA2F;AAC3F,qFAAyF;AACzF,2GAAsG;AACtG,+EAA8E;AAC9E,2EAAyE;AACzE,2FAAqF;AACrF,oFAA6D;AAM7D,MAAM,0BAA0B,GAAG,GAAG,CAAC;AAGvC,MAAM,2BAA2B,GAAsB,CAAC,mCAAe,CAAC,KAAK,CAAC,CAAC;AAG/E,MAAM,4BAA4B,GAAuB;IACxD,oCAAgB,CAAC,EAAE;IACnB,oCAAgB,CAAC,UAAU;IAC3B,oCAAgB,CAAC,SAAS;IAC1B,oCAAgB,CAAC,WAAW;IAC5B,oCAAgB,CAAC,UAAU;IAC3B,oCAAgB,CAAC,WAAW;IAC5B,oCAAgB,CAAC,iBAAiB;IAClC,oCAAgB,CAAC,GAAG;IACpB,oCAAgB,CAAC,UAAU;CAC3B,CAAC;AAGK,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAStC,YACkB,gBAAyC,EACzC,oBAA+C,EAC/C,YAA2B;QAF3B,qBAAgB,GAAhB,gBAAgB,CAAyB;QACzC,yBAAoB,GAApB,oBAAoB,CAA2B;QAC/C,iBAAY,GAAZ,YAAY,CAAe;QAX5B,WAAM,GAAG,IAAA,8BAAqB,EAAC,qCAAkB,EAAE,4BAA4B,CAAC,CAAC;QAMjF,mBAAc,GAAG,IAAI,GAAG,EAA0B,CAAC;IAMjE,CAAC;IAEJ,YAAY;QACX,IAAI,CAAC,MA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I,CAAC,MAAM,CAAC,KAAK,CAAC,2CAA2C,MAAM,yBAAyB,CAAC,CAAC;QAC/F,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,GAAG,GAAG,KAAc,CAAC;YAC3B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,iDAAiD,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QAC7F,CAAC;IACF,CAAC;CACD,CAAA;AAvHY,gEAA0B;AA6BhC;IAFL,IAAA,uBAAO,EAAC,6BAAgB,CAAC,0BAA0B,CAAC;IACpD,IAAA,uBAAO,EAAC,6BAAgB,CAAC,wBAAwB,CAAC;;qCACb,sCAAqB;;uEAO1D;qCApCW,0BAA0B;IADtC,IAAA,mBAAU,GAAE;qCAWwB,mDAAuB;QACnB,wDAAyB;QACjC,6BAAa;GAZjC,0BAA0B,CAuHtC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Repository } from 'typeorm';
|
|
2
1
|
import { OnModuleDestroy, OnModuleInit } from '@nestjs/common';
|
|
3
2
|
import { EventEmitter2 } from '@nestjs/event-emitter';
|
|
4
|
-
import {
|
|
3
|
+
import { ChannelPropertyEntity } from '../../../modules/devices/entities/devices.entity';
|
|
4
|
+
import { PropertyMetadataService } from '../../../modules/devices/services/property-metadata.service';
|
|
5
5
|
import { SpaceSensorStateService } from '../services/space-sensor-state.service';
|
|
6
6
|
export declare class SpaceSensorStateListener implements OnModuleInit, OnModuleDestroy {
|
|
7
|
-
private readonly
|
|
7
|
+
private readonly propertyMetadata;
|
|
8
8
|
private readonly sensorStateService;
|
|
9
9
|
private readonly eventEmitter;
|
|
10
10
|
private readonly logger;
|
|
11
11
|
private readonly debounceTimers;
|
|
12
|
-
constructor(
|
|
12
|
+
constructor(propertyMetadata: PropertyMetadataService, sensorStateService: SpaceSensorStateService, eventEmitter: EventEmitter2);
|
|
13
13
|
onModuleInit(): void;
|
|
14
14
|
onModuleDestroy(): void;
|
|
15
15
|
handleSensorRoleChanged(payload: {
|
|
@@ -8,19 +8,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
12
|
exports.SpaceSensorStateListener = void 0;
|
|
16
|
-
const typeorm_1 = require("typeorm");
|
|
17
13
|
const common_1 = require("@nestjs/common");
|
|
18
14
|
const event_emitter_1 = require("@nestjs/event-emitter");
|
|
19
|
-
const typeorm_2 = require("@nestjs/typeorm");
|
|
20
15
|
const logger_1 = require("../../../common/logger");
|
|
21
16
|
const transform_utils_1 = require("../../../common/utils/transform.utils");
|
|
22
17
|
const devices_constants_1 = require("../../../modules/devices/devices.constants");
|
|
23
18
|
const devices_entity_1 = require("../../../modules/devices/entities/devices.entity");
|
|
19
|
+
const property_metadata_service_1 = require("../../../modules/devices/services/property-metadata.service");
|
|
24
20
|
const spaces_constants_1 = require("../../../modules/spaces/spaces.constants");
|
|
25
21
|
const spaces_response_model_1 = require("../models/spaces-response.model");
|
|
26
22
|
const space_sensor_state_service_1 = require("../services/space-sensor-state.service");
|
|
@@ -39,8 +35,8 @@ const SENSOR_PROPERTY_CATEGORIES = [
|
|
|
39
35
|
devices_constants_1.PropertyCategory.PERCENTAGE,
|
|
40
36
|
];
|
|
41
37
|
let SpaceSensorStateListener = class SpaceSensorStateListener {
|
|
42
|
-
constructor(
|
|
43
|
-
this.
|
|
38
|
+
constructor(propertyMetadata, sensorStateService, eventEmitter) {
|
|
39
|
+
this.propertyMetadata = propertyMetadata;
|
|
44
40
|
this.sensorStateService = sensorStateService;
|
|
45
41
|
this.eventEmitter = eventEmitter;
|
|
46
42
|
this.logger = (0, logger_1.createExtensionLogger)(spaces_constants_1.SPACES_MODULE_NAME, 'SpaceSensorStateListener');
|
|
@@ -72,27 +68,19 @@ let SpaceSensorStateListener = class SpaceSensorStateListener {
|
|
|
72
68
|
}
|
|
73
69
|
}
|
|
74
70
|
async processSensorPropertyChange(property) {
|
|
75
|
-
if (!SENSOR_PROPERTY_CATEGORIES.includes(property.category)) {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
const channelId = typeof property.channel === 'string' ? property.channel : property.channel?.id;
|
|
79
|
-
if (!channelId) {
|
|
71
|
+
if (!property.id || !SENSOR_PROPERTY_CATEGORIES.includes(property.category)) {
|
|
80
72
|
return;
|
|
81
73
|
}
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
.where('channel.id = :channelId', { channelId })
|
|
86
|
-
.andWhere('device.roomId IS NOT NULL')
|
|
87
|
-
.getOne();
|
|
88
|
-
if (!channel) {
|
|
74
|
+
const metadata = await this.propertyMetadata.findOne(property.id);
|
|
75
|
+
const channel = metadata?.channel;
|
|
76
|
+
if (!channel || typeof channel === 'string') {
|
|
89
77
|
return;
|
|
90
78
|
}
|
|
91
79
|
if (!spaces_home_control_constants_1.SENSOR_CHANNEL_CATEGORIES.includes(channel.category)) {
|
|
92
80
|
return;
|
|
93
81
|
}
|
|
94
82
|
const device = channel.device;
|
|
95
|
-
const roomId = device.roomId;
|
|
83
|
+
const roomId = device && typeof device !== 'string' ? device.roomId : null;
|
|
96
84
|
if (!roomId) {
|
|
97
85
|
return;
|
|
98
86
|
}
|
|
@@ -147,8 +135,7 @@ __decorate([
|
|
|
147
135
|
], SpaceSensorStateListener.prototype, "handlePropertyChanged", null);
|
|
148
136
|
exports.SpaceSensorStateListener = SpaceSensorStateListener = __decorate([
|
|
149
137
|
(0, common_1.Injectable)(),
|
|
150
|
-
|
|
151
|
-
__metadata("design:paramtypes", [typeorm_1.Repository,
|
|
138
|
+
__metadata("design:paramtypes", [property_metadata_service_1.PropertyMetadataService,
|
|
152
139
|
space_sensor_state_service_1.SpaceSensorStateService,
|
|
153
140
|
event_emitter_1.EventEmitter2])
|
|
154
141
|
], SpaceSensorStateListener);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"space-sensor-state.listener.js","sourceRoot":"","sources":["../../../../src/plugins/spaces-home-control/listeners/space-sensor-state.listener.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"space-sensor-state.listener.js","sourceRoot":"","sources":["../../../../src/plugins/spaces-home-control/listeners/space-sensor-state.listener.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA2E;AAC3E,yDAA+D;AAE/D,mDAA+D;AAC/D,2EAAmE;AACnE,kFAA6G;AAC7G,qFAAyF;AACzF,2GAAsG;AACtG,+EAA8E;AAC9E,2EAAuE;AACvE,uFAAiF;AACjF,oFAAwF;AAMxF,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAMrC,MAAM,0BAA0B,GAAuB;IACtD,oCAAgB,CAAC,WAAW;IAC5B,oCAAgB,CAAC,QAAQ;IACzB,oCAAgB,CAAC,QAAQ;IACzB,oCAAgB,CAAC,WAAW;IAC5B,oCAAgB,CAAC,aAAa;IAC9B,oCAAgB,CAAC,GAAG;IACpB,oCAAgB,CAAC,QAAQ;IACzB,oCAAgB,CAAC,KAAK;IACtB,oCAAgB,CAAC,WAAW;IAC5B,oCAAgB,CAAC,UAAU;CAC3B,CAAC;AAGK,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IASpC,YACkB,gBAAyC,EACzC,kBAA2C,EAC3C,YAA2B;QAF3B,qBAAgB,GAAhB,gBAAgB,CAAyB;QACzC,uBAAkB,GAAlB,kBAAkB,CAAyB;QAC3C,iBAAY,GAAZ,YAAY,CAAe;QAX5B,WAAM,GAAG,IAAA,8BAAqB,EAAC,qCAAkB,EAAE,0BAA0B,CAAC,CAAC;QAM/E,mBAAc,GAAG,IAAI,GAAG,EAA0B,CAAC;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