@fastybird/smart-panel-backend 1.1.0-alpha.64 → 1.1.0-alpha.66
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.d.ts +3 -1
- package/dist/app.module.js +5 -1
- package/dist/app.module.js.map +1 -1
- package/dist/cli.js +1 -0
- package/dist/cli.js.map +1 -1
- package/dist/common/database/sqlite-data-source.d.ts +37 -0
- package/dist/common/database/sqlite-data-source.js +2131 -0
- package/dist/common/database/sqlite-data-source.js.map +1 -0
- package/dist/dataSource.d.ts +3 -1
- package/dist/dataSource.js +3 -3
- package/dist/dataSource.js.map +1 -1
- package/dist/main.js +1 -0
- package/dist/main.js.map +1 -1
- package/dist/migrations/1000000000002-AddTokenLastUsedAt.js +1 -0
- package/dist/migrations/1000000000002-AddTokenLastUsedAt.js.map +1 -1
- package/dist/migrations/1000000000027-AddVirtualProducerBindings.d.ts +7 -0
- package/dist/migrations/1000000000027-AddVirtualProducerBindings.js +87 -0
- package/dist/migrations/1000000000027-AddVirtualProducerBindings.js.map +1 -0
- package/dist/migrations/1000000000028-AddShellySampleSources.d.ts +6 -0
- package/dist/migrations/1000000000028-AddShellySampleSources.js +29 -0
- package/dist/migrations/1000000000028-AddShellySampleSources.js.map +1 -0
- package/dist/migrations/1000000000029-AddVirtualNumericTransforms.d.ts +6 -0
- package/dist/migrations/1000000000029-AddVirtualNumericTransforms.js +31 -0
- package/dist/migrations/1000000000029-AddVirtualNumericTransforms.js.map +1 -0
- package/dist/migrations/1000000000030-AddZigbeeSampleSources.d.ts +6 -0
- package/dist/migrations/1000000000030-AddZigbeeSampleSources.js +33 -0
- package/dist/migrations/1000000000030-AddZigbeeSampleSources.js.map +1 -0
- package/dist/migrations/1000000000031-AddVirtualThermostatClaims.d.ts +6 -0
- package/dist/migrations/1000000000031-AddVirtualThermostatClaims.js +62 -0
- package/dist/migrations/1000000000031-AddVirtualThermostatClaims.js.map +1 -0
- package/dist/migrations/1000000000032-AddVirtualThermostatRuntime.d.ts +6 -0
- package/dist/migrations/1000000000032-AddVirtualThermostatRuntime.js +39 -0
- package/dist/migrations/1000000000032-AddVirtualThermostatRuntime.js.map +1 -0
- package/dist/migrations/1000000000033-AddThermostatInstallationProfiles.d.ts +6 -0
- package/dist/migrations/1000000000033-AddThermostatInstallationProfiles.js +28 -0
- package/dist/migrations/1000000000033-AddThermostatInstallationProfiles.js.map +1 -0
- package/dist/migrations/1000000000034-AddVirtualThermostatRecoveries.d.ts +6 -0
- package/dist/migrations/1000000000034-AddVirtualThermostatRecoveries.js +26 -0
- package/dist/migrations/1000000000034-AddVirtualThermostatRecoveries.js.map +1 -0
- package/dist/migrations/1000000000035-IndexVirtualThermostatCommands.d.ts +6 -0
- package/dist/migrations/1000000000035-IndexVirtualThermostatCommands.js +35 -0
- package/dist/migrations/1000000000035-IndexVirtualThermostatCommands.js.map +1 -0
- package/dist/migrations/1000000000036-AddVirtualAggregatePolicies.d.ts +6 -0
- package/dist/migrations/1000000000036-AddVirtualAggregatePolicies.js +18 -0
- package/dist/migrations/1000000000036-AddVirtualAggregatePolicies.js.map +1 -0
- package/dist/migrations/1000000000037-AddVirtualAggregateProfiles.d.ts +6 -0
- package/dist/migrations/1000000000037-AddVirtualAggregateProfiles.js +16 -0
- package/dist/migrations/1000000000037-AddVirtualAggregateProfiles.js.map +1 -0
- package/dist/migrations/1000000000038-AddShellyCoverOrdering.d.ts +6 -0
- package/dist/migrations/1000000000038-AddShellyCoverOrdering.js +19 -0
- package/dist/migrations/1000000000038-AddShellyCoverOrdering.js.map +1 -0
- package/dist/migrations/1000000000039-AddVirtualThermostatComfort.d.ts +6 -0
- package/dist/migrations/1000000000039-AddVirtualThermostatComfort.js +16 -0
- package/dist/migrations/1000000000039-AddVirtualThermostatComfort.js.map +1 -0
- package/dist/migrations/1000000000040-AddThermostatBranchGroups.d.ts +6 -0
- package/dist/migrations/1000000000040-AddThermostatBranchGroups.js +32 -0
- package/dist/migrations/1000000000040-AddThermostatBranchGroups.js.map +1 -0
- package/dist/migrations/1000000000041-AddThermostatMemberProtection.d.ts +6 -0
- package/dist/migrations/1000000000041-AddThermostatMemberProtection.js +39 -0
- package/dist/migrations/1000000000041-AddThermostatMemberProtection.js.map +1 -0
- package/dist/migrations/1000000000042-AddShellyCoverRecoveries.d.ts +6 -0
- package/dist/migrations/1000000000042-AddShellyCoverRecoveries.js +19 -0
- package/dist/migrations/1000000000042-AddShellyCoverRecoveries.js.map +1 -0
- package/dist/migrations/1000000000044-AddVirtualDewPoint.d.ts +6 -0
- package/dist/migrations/1000000000044-AddVirtualDewPoint.js +36 -0
- package/dist/migrations/1000000000044-AddVirtualDewPoint.js.map +1 -0
- package/dist/migrations/1000000000045-AddThermostatCoolingDependencies.d.ts +6 -0
- package/dist/migrations/1000000000045-AddThermostatCoolingDependencies.js +32 -0
- package/dist/migrations/1000000000045-AddThermostatCoolingDependencies.js.map +1 -0
- package/dist/migrations/1000000000046-AddSpaceActivityModes.d.ts +7 -0
- package/dist/migrations/1000000000046-AddSpaceActivityModes.js +54 -0
- package/dist/migrations/1000000000046-AddSpaceActivityModes.js.map +1 -0
- package/dist/migrations/1000000000047-AddClimateAutomationOwnership.d.ts +6 -0
- package/dist/migrations/1000000000047-AddClimateAutomationOwnership.js +60 -0
- package/dist/migrations/1000000000047-AddClimateAutomationOwnership.js.map +1 -0
- package/dist/migrations/1000000000048-AddThermostatCreationCatalogBirths.d.ts +6 -0
- package/dist/migrations/1000000000048-AddThermostatCreationCatalogBirths.js +208 -0
- package/dist/migrations/1000000000048-AddThermostatCreationCatalogBirths.js.map +1 -0
- package/dist/migrations/1000000000049-FenceClimateAutomationLifecycle.d.ts +6 -0
- package/dist/migrations/1000000000049-FenceClimateAutomationLifecycle.js +40 -0
- package/dist/migrations/1000000000049-FenceClimateAutomationLifecycle.js.map +1 -0
- package/dist/migrations/1000000000050-AddSpaceModeSchedules.d.ts +6 -0
- package/dist/migrations/1000000000050-AddSpaceModeSchedules.js +36 -0
- package/dist/migrations/1000000000050-AddSpaceModeSchedules.js.map +1 -0
- package/dist/migrations/1000000000051-AddSpaceOccupancy.d.ts +6 -0
- package/dist/migrations/1000000000051-AddSpaceOccupancy.js +34 -0
- package/dist/migrations/1000000000051-AddSpaceOccupancy.js.map +1 -0
- package/dist/migrations/1000000000052-AddNativeThermostats.d.ts +6 -0
- package/dist/migrations/1000000000052-AddNativeThermostats.js +39 -0
- package/dist/migrations/1000000000052-AddNativeThermostats.js.map +1 -0
- package/dist/migrations/1000000000053-AddThermostatOverrideClocks.d.ts +6 -0
- package/dist/migrations/1000000000053-AddThermostatOverrideClocks.js +35 -0
- package/dist/migrations/1000000000053-AddThermostatOverrideClocks.js.map +1 -0
- package/dist/modules/buddy/buddy.utils.d.ts +1 -1
- package/dist/modules/buddy/buddy.utils.js +10 -11
- package/dist/modules/buddy/buddy.utils.js.map +1 -1
- package/dist/modules/buddy/services/buddy-context.service.js +2 -1
- package/dist/modules/buddy/services/buddy-context.service.js.map +1 -1
- package/dist/modules/buddy/services/home-context-tool-provider.service.d.ts +1 -1
- package/dist/modules/devices/contracts/climate-automation.contract.d.ts +111 -0
- package/dist/modules/devices/contracts/climate-automation.contract.js +3 -0
- package/dist/modules/devices/contracts/climate-automation.contract.js.map +1 -0
- package/dist/modules/devices/controllers/channels.properties.controller.d.ts +1 -1
- package/dist/modules/devices/controllers/channels.properties.controller.js +11 -4
- package/dist/modules/devices/controllers/channels.properties.controller.js.map +1 -1
- package/dist/modules/devices/controllers/devices.channels.properties.controller.d.ts +1 -1
- package/dist/modules/devices/controllers/devices.channels.properties.controller.js +11 -4
- package/dist/modules/devices/controllers/devices.channels.properties.controller.js.map +1 -1
- package/dist/modules/devices/controllers/property-command.controller.d.ts +9 -0
- package/dist/modules/devices/controllers/property-command.controller.js +88 -0
- package/dist/modules/devices/controllers/property-command.controller.js.map +1 -0
- package/dist/modules/devices/devices.constants.d.ts +4 -0
- package/dist/modules/devices/devices.constants.js +4 -0
- package/dist/modules/devices/devices.constants.js.map +1 -1
- package/dist/modules/devices/devices.module.js +22 -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 +39 -0
- package/dist/modules/devices/devices.openapi.js.map +1 -1
- package/dist/modules/devices/dto/property-command.dto.js +20 -6
- package/dist/modules/devices/dto/property-command.dto.js.map +1 -1
- package/dist/modules/devices/dto/update-device.dto.d.ts +1 -1
- package/dist/modules/devices/dto/update-device.dto.js +4 -3
- package/dist/modules/devices/dto/update-device.dto.js.map +1 -1
- package/dist/modules/devices/entities/climate-automation.entity.d.ts +56 -0
- package/dist/modules/devices/entities/climate-automation.entity.js +231 -0
- package/dist/modules/devices/entities/climate-automation.entity.js.map +1 -0
- package/dist/modules/devices/entities/devices.entity.d.ts +4 -0
- package/dist/modules/devices/entities/devices.entity.js +27 -3
- package/dist/modules/devices/entities/devices.entity.js.map +1 -1
- package/dist/modules/devices/interceptors/property-command-entry.interceptor.d.ts +10 -0
- package/dist/modules/devices/interceptors/property-command-entry.interceptor.js +50 -0
- package/dist/modules/devices/interceptors/property-command-entry.interceptor.js.map +1 -0
- package/dist/modules/devices/models/composite-command.model.d.ts +16 -0
- package/dist/modules/devices/models/composite-command.model.js +99 -0
- package/dist/modules/devices/models/composite-command.model.js.map +1 -0
- package/dist/modules/devices/models/property-command-response.model.d.ts +18 -0
- package/dist/modules/devices/models/property-command-response.model.js +90 -0
- package/dist/modules/devices/models/property-command-response.model.js.map +1 -0
- package/dist/modules/devices/models/property-read-policy.model.d.ts +4 -0
- package/dist/modules/devices/models/property-read-policy.model.js +57 -0
- package/dist/modules/devices/models/property-read-policy.model.js.map +1 -0
- package/dist/modules/devices/models/property-sample.model.d.ts +50 -0
- package/dist/modules/devices/models/property-sample.model.js +3 -0
- package/dist/modules/devices/models/property-sample.model.js.map +1 -0
- package/dist/modules/devices/models/property-value-state.model.d.ts +11 -0
- package/dist/modules/devices/models/property-value-state.model.js +55 -1
- package/dist/modules/devices/models/property-value-state.model.js.map +1 -1
- package/dist/modules/devices/platforms/device.platform.d.ts +43 -0
- package/dist/modules/devices/platforms/native-climate.contract.d.ts +50 -0
- package/dist/modules/devices/platforms/native-climate.contract.js +3 -0
- package/dist/modules/devices/platforms/native-climate.contract.js.map +1 -0
- package/dist/modules/devices/services/channels-type-mapper.service.d.ts +3 -0
- package/dist/modules/devices/services/channels-type-mapper.service.js +21 -1
- package/dist/modules/devices/services/channels-type-mapper.service.js.map +1 -1
- package/dist/modules/devices/services/channels.properties-type-mapper.service.d.ts +7 -2
- package/dist/modules/devices/services/channels.properties-type-mapper.service.js +21 -1
- package/dist/modules/devices/services/channels.properties-type-mapper.service.js.map +1 -1
- package/dist/modules/devices/services/channels.properties.service.d.ts +11 -2
- package/dist/modules/devices/services/channels.properties.service.js +219 -64
- package/dist/modules/devices/services/channels.properties.service.js.map +1 -1
- package/dist/modules/devices/services/channels.service.d.ts +12 -5
- package/dist/modules/devices/services/channels.service.js +148 -55
- package/dist/modules/devices/services/channels.service.js.map +1 -1
- package/dist/modules/devices/services/climate-automation-ledger-lifecycle.d.ts +47 -0
- package/dist/modules/devices/services/climate-automation-ledger-lifecycle.js +242 -0
- package/dist/modules/devices/services/climate-automation-ledger-lifecycle.js.map +1 -0
- package/dist/modules/devices/services/climate-automation-ledger.service.d.ts +68 -0
- package/dist/modules/devices/services/climate-automation-ledger.service.js +1061 -0
- package/dist/modules/devices/services/climate-automation-ledger.service.js.map +1 -0
- package/dist/modules/devices/services/climate-automation-ledger.utils.d.ts +8 -0
- package/dist/modules/devices/services/climate-automation-ledger.utils.js +54 -0
- package/dist/modules/devices/services/climate-automation-ledger.utils.js.map +1 -0
- package/dist/modules/devices/services/climate-automation.registry.service.d.ts +15 -0
- package/dist/modules/devices/services/climate-automation.registry.service.js +71 -0
- package/dist/modules/devices/services/climate-automation.registry.service.js.map +1 -0
- package/dist/modules/devices/services/composite-property-command.registry.service.d.ts +48 -0
- package/dist/modules/devices/services/composite-property-command.registry.service.js +65 -0
- package/dist/modules/devices/services/composite-property-command.registry.service.js.map +1 -0
- package/dist/modules/devices/services/controller-publication-context.d.ts +27 -0
- package/dist/modules/devices/services/controller-publication-context.js +148 -0
- package/dist/modules/devices/services/controller-publication-context.js.map +1 -0
- package/dist/modules/devices/services/cover-action-proof.d.ts +7 -0
- package/dist/modules/devices/services/cover-action-proof.js +142 -0
- package/dist/modules/devices/services/cover-action-proof.js.map +1 -0
- package/dist/modules/devices/services/creation-capture.d.ts +19 -0
- package/dist/modules/devices/services/creation-capture.js +85 -0
- package/dist/modules/devices/services/creation-capture.js.map +1 -0
- package/dist/modules/devices/services/device-command-graph.service.js +1 -1
- package/dist/modules/devices/services/device-command-graph.service.js.map +1 -1
- package/dist/modules/devices/services/device-connection-state.service.d.ts +1 -0
- package/dist/modules/devices/services/device-connection-state.service.js +64 -18
- package/dist/modules/devices/services/device-connection-state.service.js.map +1 -1
- package/dist/modules/devices/services/device-connectivity.service.js +96 -51
- package/dist/modules/devices/services/device-connectivity.service.js.map +1 -1
- package/dist/modules/devices/services/device-contribution.registry.service.d.ts +50 -0
- package/dist/modules/devices/services/device-contribution.registry.service.js +45 -0
- package/dist/modules/devices/services/device-contribution.registry.service.js.map +1 -0
- package/dist/modules/devices/services/device-creation-context.d.ts +57 -0
- package/dist/modules/devices/services/device-creation-context.js +315 -0
- package/dist/modules/devices/services/device-creation-context.js.map +1 -0
- package/dist/modules/devices/services/device-structure-lock.service.d.ts +5 -0
- package/dist/modules/devices/services/device-structure-lock.service.js +64 -12
- package/dist/modules/devices/services/device-structure-lock.service.js.map +1 -1
- package/dist/modules/devices/services/device-validation.service.d.ts +0 -1
- package/dist/modules/devices/services/device-validation.service.js +3 -14
- package/dist/modules/devices/services/device-validation.service.js.map +1 -1
- package/dist/modules/devices/services/device-zones.service.d.ts +3 -1
- package/dist/modules/devices/services/device-zones.service.js +30 -6
- package/dist/modules/devices/services/device-zones.service.js.map +1 -1
- package/dist/modules/devices/services/devices-type-mapper.service.d.ts +3 -0
- package/dist/modules/devices/services/devices-type-mapper.service.js +21 -1
- package/dist/modules/devices/services/devices-type-mapper.service.js.map +1 -1
- package/dist/modules/devices/services/devices.service.d.ts +8 -2
- package/dist/modules/devices/services/devices.service.js +194 -49
- package/dist/modules/devices/services/devices.service.js.map +1 -1
- package/dist/modules/devices/services/platform.registry.service.d.ts +11 -1
- package/dist/modules/devices/services/platform.registry.service.js +42 -5
- package/dist/modules/devices/services/platform.registry.service.js.map +1 -1
- package/dist/modules/devices/services/property-command-admission.registry.service.d.ts +28 -0
- package/dist/modules/devices/services/property-command-admission.registry.service.js +70 -0
- package/dist/modules/devices/services/property-command-admission.registry.service.js.map +1 -0
- package/dist/modules/devices/services/property-command-dispatch.service.d.ts +28 -2
- package/dist/modules/devices/services/property-command-dispatch.service.js +704 -10
- package/dist/modules/devices/services/property-command-dispatch.service.js.map +1 -1
- package/dist/modules/devices/services/property-command-entry-snapshot.d.ts +25 -0
- package/dist/modules/devices/services/property-command-entry-snapshot.js +87 -0
- package/dist/modules/devices/services/property-command-entry-snapshot.js.map +1 -0
- package/dist/modules/devices/services/property-command-window.service.d.ts +22 -0
- package/dist/modules/devices/services/property-command-window.service.js +81 -0
- package/dist/modules/devices/services/property-command-window.service.js.map +1 -1
- package/dist/modules/devices/services/property-command.service.d.ts +24 -3
- package/dist/modules/devices/services/property-command.service.js +180 -18
- package/dist/modules/devices/services/property-command.service.js.map +1 -1
- package/dist/modules/devices/services/property-metadata.service.js +1 -1
- package/dist/modules/devices/services/property-metadata.service.js.map +1 -1
- package/dist/modules/devices/services/property-producer.registry.service.d.ts +98 -0
- package/dist/modules/devices/services/property-producer.registry.service.js +636 -0
- package/dist/modules/devices/services/property-producer.registry.service.js.map +1 -0
- package/dist/modules/devices/services/property-value-source.registry.service.d.ts +18 -0
- package/dist/modules/devices/services/property-value-source.registry.service.js +291 -2
- package/dist/modules/devices/services/property-value-source.registry.service.js.map +1 -1
- package/dist/modules/devices/services/property-value.service.d.ts +40 -3
- package/dist/modules/devices/services/property-value.service.js +744 -193
- package/dist/modules/devices/services/property-value.service.js.map +1 -1
- package/dist/modules/devices/subscribers/channel-property-entity.subscriber.d.ts +5 -0
- package/dist/modules/devices/subscribers/channel-property-entity.subscriber.js +25 -0
- package/dist/modules/devices/subscribers/channel-property-entity.subscriber.js.map +1 -1
- package/dist/modules/devices/utils/property-metadata.utils.d.ts +1 -0
- package/dist/modules/devices/utils/property-metadata.utils.js +10 -0
- package/dist/modules/devices/utils/property-metadata.utils.js.map +1 -1
- package/dist/modules/devices/utils/property-permissions.utils.d.ts +2 -0
- package/dist/modules/devices/utils/property-permissions.utils.js +10 -0
- package/dist/modules/devices/utils/property-permissions.utils.js.map +1 -0
- package/dist/modules/extensions/services/discovered-backend.module.d.ts +6 -0
- package/dist/modules/extensions/services/discovered-backend.module.js +32 -0
- package/dist/modules/extensions/services/discovered-backend.module.js.map +1 -0
- package/dist/modules/extensions/services/extensions-discovery.js +15 -0
- package/dist/modules/extensions/services/extensions-discovery.js.map +1 -1
- package/dist/modules/extensions/services/extensions.service.d.ts +4 -0
- package/dist/modules/extensions/services/extensions.service.js +13 -0
- package/dist/modules/extensions/services/extensions.service.js.map +1 -1
- package/dist/modules/extensions/services/managed-extension-service.interface.d.ts +1 -0
- package/dist/modules/extensions/services/managed-service-manager.service.d.ts +15 -0
- package/dist/modules/extensions/services/managed-service-manager.service.js +242 -72
- package/dist/modules/extensions/services/managed-service-manager.service.js.map +1 -1
- package/dist/modules/home-context/schemas/home-search-input.schemas.d.ts +1 -1
- package/dist/modules/intents/models/intent.model.d.ts +2 -0
- package/dist/modules/intents/models/intent.model.js +14 -0
- package/dist/modules/intents/models/intent.model.js.map +1 -1
- package/dist/modules/intents/services/intents.service.d.ts +2 -1
- package/dist/modules/intents/services/intents.service.js +18 -2
- package/dist/modules/intents/services/intents.service.js.map +1 -1
- package/dist/modules/scenes/listeners/websocket-exchange.listener.js +4 -0
- package/dist/modules/scenes/listeners/websocket-exchange.listener.js.map +1 -1
- package/dist/modules/scenes/models/scenes.model.d.ts +2 -0
- package/dist/modules/scenes/models/scenes.model.js +10 -0
- package/dist/modules/scenes/models/scenes.model.js.map +1 -1
- package/dist/modules/scenes/services/scene-executor.service.d.ts +6 -1
- package/dist/modules/scenes/services/scene-executor.service.js +33 -22
- package/dist/modules/scenes/services/scene-executor.service.js.map +1 -1
- package/dist/modules/security/providers/alarm-security.provider.d.ts +3 -1
- package/dist/modules/security/providers/alarm-security.provider.js +83 -8
- package/dist/modules/security/providers/alarm-security.provider.js.map +1 -1
- package/dist/modules/spaces/services/space-lifecycle-registry.service.d.ts +19 -0
- package/dist/modules/spaces/services/space-lifecycle-registry.service.js +121 -0
- package/dist/modules/spaces/services/space-lifecycle-registry.service.js.map +1 -0
- package/dist/modules/spaces/services/spaces.service.d.ts +5 -1
- package/dist/modules/spaces/services/spaces.service.js +34 -6
- package/dist/modules/spaces/services/spaces.service.js.map +1 -1
- package/dist/modules/spaces/spaces.constants.d.ts +3 -1
- package/dist/modules/spaces/spaces.constants.js +2 -0
- package/dist/modules/spaces/spaces.constants.js.map +1 -1
- package/dist/modules/spaces/spaces.module.js +13 -1
- package/dist/modules/spaces/spaces.module.js.map +1 -1
- package/dist/modules/storage/services/storage.service.d.ts +8 -0
- package/dist/modules/storage/services/storage.service.js +225 -0
- package/dist/modules/storage/services/storage.service.js.map +1 -1
- package/dist/modules/swagger/decorators/api-documentation.decorator.d.ts +1 -0
- package/dist/modules/swagger/decorators/api-documentation.decorator.js +9 -1
- package/dist/modules/swagger/decorators/api-documentation.decorator.js.map +1 -1
- package/dist/modules/swagger/services/swagger-document.service.d.ts +1 -0
- package/dist/modules/swagger/services/swagger-document.service.js +71 -1
- package/dist/modules/swagger/services/swagger-document.service.js.map +1 -1
- package/dist/modules/system/services/backup.service.js +3 -5
- package/dist/modules/system/services/backup.service.js.map +1 -1
- package/dist/modules/system/utils/timezone.utils.d.ts +2 -0
- package/dist/modules/system/utils/timezone.utils.js +9 -0
- package/dist/modules/system/utils/timezone.utils.js.map +1 -0
- package/dist/modules/websocket/gateway/websocket.gateway.js +1 -0
- package/dist/modules/websocket/gateway/websocket.gateway.js.map +1 -1
- package/dist/plugins/devices-home-assistant/devices-home-assistant.plugin.js +2 -0
- package/dist/plugins/devices-home-assistant/devices-home-assistant.plugin.js.map +1 -1
- package/dist/plugins/devices-home-assistant/dto/update-channel-property.dto.d.ts +3 -3
- package/dist/plugins/devices-home-assistant/dto/update-channel-property.dto.js +3 -3
- package/dist/plugins/devices-home-assistant/dto/update-channel-property.dto.js.map +1 -1
- package/dist/plugins/devices-home-assistant/platforms/home-assistant.device.platform.d.ts +11 -1
- package/dist/plugins/devices-home-assistant/platforms/home-assistant.device.platform.js +82 -2
- package/dist/plugins/devices-home-assistant/platforms/home-assistant.device.platform.js.map +1 -1
- package/dist/plugins/devices-home-assistant/services/home-assistant-native-climate.service.d.ts +22 -0
- package/dist/plugins/devices-home-assistant/services/home-assistant-native-climate.service.js +409 -0
- package/dist/plugins/devices-home-assistant/services/home-assistant-native-climate.service.js.map +1 -0
- package/dist/plugins/devices-home-assistant/services/home-assistant.ws.service.d.ts +14 -0
- package/dist/plugins/devices-home-assistant/services/home-assistant.ws.service.js +93 -3
- package/dist/plugins/devices-home-assistant/services/home-assistant.ws.service.js.map +1 -1
- package/dist/plugins/devices-homekit/devices-homekit.plugin.js +28 -2
- package/dist/plugins/devices-homekit/devices-homekit.plugin.js.map +1 -1
- package/dist/plugins/devices-homekit/listeners/homekit-event.listener.d.ts +26 -3
- package/dist/plugins/devices-homekit/listeners/homekit-event.listener.js +183 -5
- package/dist/plugins/devices-homekit/listeners/homekit-event.listener.js.map +1 -1
- package/dist/plugins/devices-homekit/mappers/base.mapper.d.ts +2 -1
- package/dist/plugins/devices-homekit/mappers/base.mapper.js +38 -10
- package/dist/plugins/devices-homekit/mappers/base.mapper.js.map +1 -1
- package/dist/plugins/devices-homekit/mappers/battery.mapper.js +4 -3
- package/dist/plugins/devices-homekit/mappers/battery.mapper.js.map +1 -1
- package/dist/plugins/devices-homekit/mappers/button.mapper.js +21 -2
- package/dist/plugins/devices-homekit/mappers/button.mapper.js.map +1 -1
- package/dist/plugins/devices-homekit/mappers/characteristic-get.d.ts +3 -0
- package/dist/plugins/devices-homekit/mappers/characteristic-get.js +10 -0
- package/dist/plugins/devices-homekit/mappers/characteristic-get.js.map +1 -0
- package/dist/plugins/devices-homekit/mappers/characteristic-write.d.ts +1 -1
- package/dist/plugins/devices-homekit/mappers/characteristic-write.js +2 -1
- package/dist/plugins/devices-homekit/mappers/characteristic-write.js.map +1 -1
- package/dist/plugins/devices-homekit/mappers/fan.mapper.d.ts +12 -0
- package/dist/plugins/devices-homekit/mappers/fan.mapper.js +126 -0
- package/dist/plugins/devices-homekit/mappers/fan.mapper.js.map +1 -0
- package/dist/plugins/devices-homekit/mappers/homekit-mapper.interface.d.ts +8 -0
- package/dist/plugins/devices-homekit/mappers/outlet.mapper.js +4 -0
- package/dist/plugins/devices-homekit/mappers/outlet.mapper.js.map +1 -1
- package/dist/plugins/devices-homekit/mappers/property-read.d.ts +7 -0
- package/dist/plugins/devices-homekit/mappers/property-read.js +64 -0
- package/dist/plugins/devices-homekit/mappers/property-read.js.map +1 -0
- package/dist/plugins/devices-homekit/mappers/semantic-conversion.d.ts +2 -0
- package/dist/plugins/devices-homekit/mappers/semantic-conversion.js +15 -0
- package/dist/plugins/devices-homekit/mappers/semantic-conversion.js.map +1 -0
- package/dist/plugins/devices-homekit/mappers/sensor.mapper.d.ts +3 -0
- package/dist/plugins/devices-homekit/mappers/sensor.mapper.js +63 -11
- package/dist/plugins/devices-homekit/mappers/sensor.mapper.js.map +1 -1
- package/dist/plugins/devices-homekit/mappers/service-fault.d.ts +4 -0
- package/dist/plugins/devices-homekit/mappers/service-fault.js +33 -0
- package/dist/plugins/devices-homekit/mappers/service-fault.js.map +1 -0
- package/dist/plugins/devices-homekit/mappers/thermostat-coordinator.d.ts +4 -0
- package/dist/plugins/devices-homekit/mappers/thermostat-coordinator.js +128 -19
- package/dist/plugins/devices-homekit/mappers/thermostat-coordinator.js.map +1 -1
- package/dist/plugins/devices-homekit/mappers/thermostat.mapper.js +5 -3
- package/dist/plugins/devices-homekit/mappers/thermostat.mapper.js.map +1 -1
- package/dist/plugins/devices-homekit/mappers/unavailable-characteristic.d.ts +3 -0
- package/dist/plugins/devices-homekit/mappers/unavailable-characteristic.js +18 -0
- package/dist/plugins/devices-homekit/mappers/unavailable-characteristic.js.map +1 -0
- package/dist/plugins/devices-homekit/mappers/window-covering.mapper.js +19 -3
- package/dist/plugins/devices-homekit/mappers/window-covering.mapper.js.map +1 -1
- package/dist/plugins/devices-homekit/services/homekit-bridge.service.d.ts +4 -0
- package/dist/plugins/devices-homekit/services/homekit-bridge.service.js +58 -29
- package/dist/plugins/devices-homekit/services/homekit-bridge.service.js.map +1 -1
- package/dist/plugins/devices-homekit/services/homekit-command.dispatcher.d.ts +2 -0
- package/dist/plugins/devices-homekit/services/homekit-command.dispatcher.js +3 -0
- package/dist/plugins/devices-homekit/services/homekit-command.dispatcher.js.map +1 -1
- package/dist/plugins/devices-homekit/services/homekit-mapper-registry.service.d.ts +30 -2
- package/dist/plugins/devices-homekit/services/homekit-mapper-registry.service.js +126 -2
- package/dist/plugins/devices-homekit/services/homekit-mapper-registry.service.js.map +1 -1
- package/dist/plugins/devices-homekit/services/homekit-mapping-maintenance.d.ts +8 -0
- package/dist/plugins/devices-homekit/services/homekit-mapping-maintenance.js +17 -0
- package/dist/plugins/devices-homekit/services/homekit-mapping-maintenance.js.map +1 -0
- package/dist/plugins/devices-homekit/services/homekit-property-state.service.d.ts +19 -0
- package/dist/plugins/devices-homekit/services/homekit-property-state.service.js +69 -0
- package/dist/plugins/devices-homekit/services/homekit-property-state.service.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/contracts/cover-action.contract.d.ts +13 -0
- package/dist/plugins/devices-shelly-ng/contracts/cover-action.contract.js +60 -0
- package/dist/plugins/devices-shelly-ng/contracts/cover-action.contract.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/contracts/cover-recovery.contract.d.ts +13 -0
- package/dist/plugins/devices-shelly-ng/contracts/cover-recovery.contract.js +3 -0
- package/dist/plugins/devices-shelly-ng/contracts/cover-recovery.contract.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/contracts/guard-script-source.d.ts +1 -0
- package/dist/plugins/devices-shelly-ng/contracts/guard-script-source.js +5 -0
- package/dist/plugins/devices-shelly-ng/contracts/guard-script-source.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/contracts/guard-script.contract.d.ts +21 -0
- package/dist/plugins/devices-shelly-ng/contracts/guard-script.contract.js +47 -0
- package/dist/plugins/devices-shelly-ng/contracts/guard-script.contract.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/contracts/member-guard-script-source.d.ts +2 -0
- package/dist/plugins/devices-shelly-ng/contracts/member-guard-script-source.js +27 -0
- package/dist/plugins/devices-shelly-ng/contracts/member-guard-script-source.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/contracts/native-temperature.contract.d.ts +36 -0
- package/dist/plugins/devices-shelly-ng/contracts/native-temperature.contract.js +200 -0
- package/dist/plugins/devices-shelly-ng/contracts/native-temperature.contract.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/contracts/protective-switch.contract.d.ts +44 -0
- package/dist/plugins/devices-shelly-ng/contracts/protective-switch.contract.js +29 -0
- package/dist/plugins/devices-shelly-ng/contracts/protective-switch.contract.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/controllers/shelly-cover-recovery.controller.d.ts +11 -0
- package/dist/plugins/devices-shelly-ng/controllers/shelly-cover-recovery.controller.js +98 -0
- package/dist/plugins/devices-shelly-ng/controllers/shelly-cover-recovery.controller.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/delegates/delegates-manager.service.d.ts +51 -1
- package/dist/plugins/devices-shelly-ng/delegates/delegates-manager.service.js +688 -2
- 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 +46 -1
- package/dist/plugins/devices-shelly-ng/delegates/shelly-device.delegate.js +315 -4
- package/dist/plugins/devices-shelly-ng/delegates/shelly-device.delegate.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/devices-shelly-ng.openapi.d.ts +3 -1
- package/dist/plugins/devices-shelly-ng/devices-shelly-ng.openapi.js +8 -0
- package/dist/plugins/devices-shelly-ng/devices-shelly-ng.openapi.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/devices-shelly-ng.plugin.js +16 -1
- package/dist/plugins/devices-shelly-ng/devices-shelly-ng.plugin.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/dto/cover-recovery.dto.d.ts +11 -0
- package/dist/plugins/devices-shelly-ng/dto/cover-recovery.dto.js +77 -0
- package/dist/plugins/devices-shelly-ng/dto/cover-recovery.dto.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/entities/shelly-cover-ordering.entity.d.ts +5 -0
- package/dist/plugins/devices-shelly-ng/entities/shelly-cover-ordering.entity.js +32 -0
- package/dist/plugins/devices-shelly-ng/entities/shelly-cover-ordering.entity.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/entities/shelly-cover-recovery.entity.d.ts +17 -0
- package/dist/plugins/devices-shelly-ng/entities/shelly-cover-recovery.entity.js +80 -0
- package/dist/plugins/devices-shelly-ng/entities/shelly-cover-recovery.entity.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/entities/shelly-sample-source.entity.d.ts +16 -0
- package/dist/plugins/devices-shelly-ng/entities/shelly-sample-source.entity.js +70 -0
- package/dist/plugins/devices-shelly-ng/entities/shelly-sample-source.entity.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/mappings/definitions/covers.yaml +30 -24
- package/dist/plugins/devices-shelly-ng/models/cover-recovery.model.d.ts +21 -0
- package/dist/plugins/devices-shelly-ng/models/cover-recovery.model.js +114 -0
- package/dist/plugins/devices-shelly-ng/models/cover-recovery.model.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/platforms/shelly-ng.device.platform.d.ts +27 -1
- package/dist/plugins/devices-shelly-ng/platforms/shelly-ng.device.platform.js +146 -0
- package/dist/plugins/devices-shelly-ng/platforms/shelly-ng.device.platform.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/services/authenticated-shelly-script-http.d.ts +16 -0
- package/dist/plugins/devices-shelly-ng/services/authenticated-shelly-script-http.js +154 -0
- package/dist/plugins/devices-shelly-ng/services/authenticated-shelly-script-http.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/services/device-manager.service.d.ts +4 -1
- package/dist/plugins/devices-shelly-ng/services/device-manager.service.js +113 -4
- package/dist/plugins/devices-shelly-ng/services/device-manager.service.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/services/guarded-shelly-http.d.ts +2 -0
- package/dist/plugins/devices-shelly-ng/services/guarded-shelly-http.js +78 -0
- package/dist/plugins/devices-shelly-ng/services/guarded-shelly-http.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/services/guarded-shelly-rpc.d.ts +9 -0
- package/dist/plugins/devices-shelly-ng/services/guarded-shelly-rpc.js +56 -0
- package/dist/plugins/devices-shelly-ng/services/guarded-shelly-rpc.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/services/remote-dew-point-artifact.d.ts +45 -0
- package/dist/plugins/devices-shelly-ng/services/remote-dew-point-artifact.js +278 -0
- package/dist/plugins/devices-shelly-ng/services/remote-dew-point-artifact.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/services/remote-dew-point-lease.contract.d.ts +49 -0
- package/dist/plugins/devices-shelly-ng/services/remote-dew-point-lease.contract.js +32 -0
- package/dist/plugins/devices-shelly-ng/services/remote-dew-point-lease.contract.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/services/remote-dew-point-qualification.d.ts +53 -0
- package/dist/plugins/devices-shelly-ng/services/remote-dew-point-qualification.js +91 -0
- package/dist/plugins/devices-shelly-ng/services/remote-dew-point-qualification.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/services/remote-dew-point-session.d.ts +35 -0
- package/dist/plugins/devices-shelly-ng/services/remote-dew-point-session.js +244 -0
- package/dist/plugins/devices-shelly-ng/services/remote-dew-point-session.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-cover-ordering.service.d.ts +9 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-cover-ordering.service.js +50 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-cover-ordering.service.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-cover-recovery-lane.service.d.ts +29 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-cover-recovery-lane.service.js +166 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-cover-recovery-lane.service.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-cover-recovery.service.d.ts +21 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-cover-recovery.service.js +207 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-cover-recovery.service.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-cover-session.d.ts +25 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-cover-session.js +132 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-cover-session.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-cover-telemetry.d.ts +9 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-cover-telemetry.js +63 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-cover-telemetry.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-guard-rpc-session.d.ts +33 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-guard-rpc-session.js +191 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-guard-rpc-session.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-ng.service.d.ts +3 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-ng.service.js +32 -4
- package/dist/plugins/devices-shelly-ng/services/shelly-ng.service.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/services/shelly-sample-sources.service.d.ts +34 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-sample-sources.service.js +194 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-sample-sources.service.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-ws-server.service.js +5 -2
- package/dist/plugins/devices-shelly-ng/services/shelly-ws-server.service.js.map +1 -1
- package/dist/plugins/devices-shelly-v1/platforms/shelly-v1.device.platform.d.ts +4 -0
- package/dist/plugins/devices-shelly-v1/platforms/shelly-v1.device.platform.js +3 -0
- package/dist/plugins/devices-shelly-v1/platforms/shelly-v1.device.platform.js.map +1 -1
- package/dist/plugins/devices-virtual/contracts/thermostat-actuation.contract.d.ts +114 -0
- package/dist/plugins/devices-virtual/contracts/thermostat-actuation.contract.js +12 -0
- package/dist/plugins/devices-virtual/contracts/thermostat-actuation.contract.js.map +1 -0
- package/dist/plugins/devices-virtual/contracts/thermostat-command.contract.d.ts +4 -0
- package/dist/plugins/devices-virtual/contracts/thermostat-command.contract.js +3 -0
- package/dist/plugins/devices-virtual/contracts/thermostat-command.contract.js.map +1 -0
- package/dist/plugins/devices-virtual/controllers/native-thermostat.controller.d.ts +15 -0
- package/dist/plugins/devices-virtual/controllers/native-thermostat.controller.js +178 -0
- package/dist/plugins/devices-virtual/controllers/native-thermostat.controller.js.map +1 -0
- package/dist/plugins/devices-virtual/controllers/thermostat-authoring-context.controller.d.ts +11 -0
- package/dist/plugins/devices-virtual/controllers/thermostat-authoring-context.controller.js +92 -0
- package/dist/plugins/devices-virtual/controllers/thermostat-authoring-context.controller.js.map +1 -0
- package/dist/plugins/devices-virtual/controllers/thermostat-installation.controller.d.ts +16 -0
- package/dist/plugins/devices-virtual/controllers/thermostat-installation.controller.js +179 -0
- package/dist/plugins/devices-virtual/controllers/thermostat-installation.controller.js.map +1 -0
- package/dist/plugins/devices-virtual/controllers/virtual-dew-point-config.controller.d.ts +11 -0
- package/dist/plugins/devices-virtual/controllers/virtual-dew-point-config.controller.js +100 -0
- package/dist/plugins/devices-virtual/controllers/virtual-dew-point-config.controller.js.map +1 -0
- package/dist/plugins/devices-virtual/controllers/virtual-measurement-authoring.controller.d.ts +19 -0
- package/dist/plugins/devices-virtual/controllers/virtual-measurement-authoring.controller.js +168 -0
- package/dist/plugins/devices-virtual/controllers/virtual-measurement-authoring.controller.js.map +1 -0
- package/dist/plugins/devices-virtual/controllers/virtual-producer-config.controller.d.ts +28 -0
- package/dist/plugins/devices-virtual/controllers/virtual-producer-config.controller.js +278 -0
- package/dist/plugins/devices-virtual/controllers/virtual-producer-config.controller.js.map +1 -0
- package/dist/plugins/devices-virtual/controllers/virtual-thermostat-authoring.controller.d.ts +12 -0
- package/dist/plugins/devices-virtual/controllers/virtual-thermostat-authoring.controller.js +111 -0
- package/dist/plugins/devices-virtual/controllers/virtual-thermostat-authoring.controller.js.map +1 -0
- package/dist/plugins/devices-virtual/controllers/virtual-thermostat-comfort.controller.d.ts +14 -0
- package/dist/plugins/devices-virtual/controllers/virtual-thermostat-comfort.controller.js +160 -0
- package/dist/plugins/devices-virtual/controllers/virtual-thermostat-comfort.controller.js.map +1 -0
- package/dist/plugins/devices-virtual/controllers/virtual-thermostat-config.controller.d.ts +18 -0
- package/dist/plugins/devices-virtual/controllers/virtual-thermostat-config.controller.js +196 -0
- package/dist/plugins/devices-virtual/controllers/virtual-thermostat-config.controller.js.map +1 -0
- package/dist/plugins/devices-virtual/controllers/virtual-transform-config.controller.d.ts +14 -0
- package/dist/plugins/devices-virtual/controllers/virtual-transform-config.controller.js +128 -0
- package/dist/plugins/devices-virtual/controllers/virtual-transform-config.controller.js.map +1 -0
- package/dist/plugins/devices-virtual/devices-virtual.constants.d.ts +1 -0
- package/dist/plugins/devices-virtual/devices-virtual.constants.js +2 -1
- package/dist/plugins/devices-virtual/devices-virtual.constants.js.map +1 -1
- package/dist/plugins/devices-virtual/devices-virtual.openapi.d.ts +24 -2
- package/dist/plugins/devices-virtual/devices-virtual.openapi.js +95 -0
- package/dist/plugins/devices-virtual/devices-virtual.openapi.js.map +1 -1
- package/dist/plugins/devices-virtual/devices-virtual.plugin.d.ts +7 -1
- package/dist/plugins/devices-virtual/devices-virtual.plugin.js +167 -10
- package/dist/plugins/devices-virtual/devices-virtual.plugin.js.map +1 -1
- package/dist/plugins/devices-virtual/dto/create-device.dto.d.ts +2 -0
- package/dist/plugins/devices-virtual/dto/create-device.dto.js +20 -0
- package/dist/plugins/devices-virtual/dto/create-device.dto.js.map +1 -1
- package/dist/plugins/devices-virtual/dto/dew-point-config.dto.d.ts +14 -0
- package/dist/plugins/devices-virtual/dto/dew-point-config.dto.js +119 -0
- package/dist/plugins/devices-virtual/dto/dew-point-config.dto.js.map +1 -0
- package/dist/plugins/devices-virtual/dto/group-catalog.dto.d.ts +8 -0
- package/dist/plugins/devices-virtual/dto/group-catalog.dto.js +62 -0
- package/dist/plugins/devices-virtual/dto/group-catalog.dto.js.map +1 -0
- package/dist/plugins/devices-virtual/dto/light-group-draft.dto.d.ts +19 -0
- package/dist/plugins/devices-virtual/dto/light-group-draft.dto.js +108 -0
- package/dist/plugins/devices-virtual/dto/light-group-draft.dto.js.map +1 -0
- package/dist/plugins/devices-virtual/dto/measurement-authoring.dto.d.ts +25 -0
- package/dist/plugins/devices-virtual/dto/measurement-authoring.dto.js +157 -0
- package/dist/plugins/devices-virtual/dto/measurement-authoring.dto.js.map +1 -0
- package/dist/plugins/devices-virtual/dto/native-thermostat.dto.d.ts +21 -0
- package/dist/plugins/devices-virtual/dto/native-thermostat.dto.js +122 -0
- package/dist/plugins/devices-virtual/dto/native-thermostat.dto.js.map +1 -0
- package/dist/plugins/devices-virtual/dto/producer-config.dto.d.ts +35 -0
- package/dist/plugins/devices-virtual/dto/producer-config.dto.js +290 -0
- package/dist/plugins/devices-virtual/dto/producer-config.dto.js.map +1 -0
- package/dist/plugins/devices-virtual/dto/thermostat-authoring.dto.d.ts +6 -0
- package/dist/plugins/devices-virtual/dto/thermostat-authoring.dto.js +46 -0
- package/dist/plugins/devices-virtual/dto/thermostat-authoring.dto.js.map +1 -0
- package/dist/plugins/devices-virtual/dto/thermostat-comfort.dto.d.ts +39 -0
- package/dist/plugins/devices-virtual/dto/thermostat-comfort.dto.js +244 -0
- package/dist/plugins/devices-virtual/dto/thermostat-comfort.dto.js.map +1 -0
- package/dist/plugins/devices-virtual/dto/thermostat-config.dto.d.ts +94 -0
- package/dist/plugins/devices-virtual/dto/thermostat-config.dto.js +718 -0
- package/dist/plugins/devices-virtual/dto/thermostat-config.dto.js.map +1 -0
- package/dist/plugins/devices-virtual/dto/thermostat-installation.dto.d.ts +71 -0
- package/dist/plugins/devices-virtual/dto/thermostat-installation.dto.js +410 -0
- package/dist/plugins/devices-virtual/dto/thermostat-installation.dto.js.map +1 -0
- package/dist/plugins/devices-virtual/dto/transform-config.dto.d.ts +71 -0
- package/dist/plugins/devices-virtual/dto/transform-config.dto.js +430 -0
- package/dist/plugins/devices-virtual/dto/transform-config.dto.js.map +1 -0
- package/dist/plugins/devices-virtual/dto/update-device.dto.d.ts +2 -0
- package/dist/plugins/devices-virtual/dto/update-device.dto.js +20 -0
- package/dist/plugins/devices-virtual/dto/update-device.dto.js.map +1 -1
- package/dist/plugins/devices-virtual/entities/devices-virtual.entity.d.ts +13 -1
- package/dist/plugins/devices-virtual/entities/devices-virtual.entity.js +56 -6
- package/dist/plugins/devices-virtual/entities/devices-virtual.entity.js.map +1 -1
- package/dist/plugins/devices-virtual/entities/native-thermostat.entity.d.ts +23 -0
- package/dist/plugins/devices-virtual/entities/native-thermostat.entity.js +103 -0
- package/dist/plugins/devices-virtual/entities/native-thermostat.entity.js.map +1 -0
- package/dist/plugins/devices-virtual/entities/thermostat-cooling-dependency.entity.d.ts +19 -0
- package/dist/plugins/devices-virtual/entities/thermostat-cooling-dependency.entity.js +87 -0
- package/dist/plugins/devices-virtual/entities/thermostat-cooling-dependency.entity.js.map +1 -0
- package/dist/plugins/devices-virtual/entities/thermostat-installation.entity.d.ts +36 -0
- package/dist/plugins/devices-virtual/entities/thermostat-installation.entity.js +125 -0
- package/dist/plugins/devices-virtual/entities/thermostat-installation.entity.js.map +1 -0
- package/dist/plugins/devices-virtual/entities/thermostat-member-protection.entity.d.ts +15 -0
- package/dist/plugins/devices-virtual/entities/thermostat-member-protection.entity.js +70 -0
- package/dist/plugins/devices-virtual/entities/thermostat-member-protection.entity.js.map +1 -0
- package/dist/plugins/devices-virtual/entities/thermostat-override-clock.entity.d.ts +7 -0
- package/dist/plugins/devices-virtual/entities/thermostat-override-clock.entity.js +39 -0
- package/dist/plugins/devices-virtual/entities/thermostat-override-clock.entity.js.map +1 -0
- package/dist/plugins/devices-virtual/entities/virtual-dew-point.entity.d.ts +28 -0
- package/dist/plugins/devices-virtual/entities/virtual-dew-point.entity.js +104 -0
- package/dist/plugins/devices-virtual/entities/virtual-dew-point.entity.js.map +1 -0
- package/dist/plugins/devices-virtual/entities/virtual-producer.entity.d.ts +89 -0
- package/dist/plugins/devices-virtual/entities/virtual-producer.entity.js +281 -0
- package/dist/plugins/devices-virtual/entities/virtual-producer.entity.js.map +1 -0
- package/dist/plugins/devices-virtual/entities/virtual-thermostat-runtime.entity.d.ts +45 -0
- package/dist/plugins/devices-virtual/entities/virtual-thermostat-runtime.entity.js +184 -0
- package/dist/plugins/devices-virtual/entities/virtual-thermostat-runtime.entity.js.map +1 -0
- package/dist/plugins/devices-virtual/entities/virtual-thermostat.entity.d.ts +86 -0
- package/dist/plugins/devices-virtual/entities/virtual-thermostat.entity.js +337 -0
- package/dist/plugins/devices-virtual/entities/virtual-thermostat.entity.js.map +1 -0
- package/dist/plugins/devices-virtual/entities/virtual-transform.entity.d.ts +23 -0
- package/dist/plugins/devices-virtual/entities/virtual-transform.entity.js +101 -0
- package/dist/plugins/devices-virtual/entities/virtual-transform.entity.js.map +1 -0
- package/dist/plugins/devices-virtual/listeners/virtual-device-information.listener.d.ts +5 -0
- package/dist/plugins/devices-virtual/listeners/virtual-device-information.listener.js +65 -22
- package/dist/plugins/devices-virtual/listeners/virtual-device-information.listener.js.map +1 -1
- package/dist/plugins/devices-virtual/listeners/virtual-index-maintenance.listener.d.ts +8 -1
- package/dist/plugins/devices-virtual/listeners/virtual-index-maintenance.listener.js +123 -32
- package/dist/plugins/devices-virtual/listeners/virtual-index-maintenance.listener.js.map +1 -1
- package/dist/plugins/devices-virtual/listeners/virtual-projection.listener.d.ts +3 -0
- package/dist/plugins/devices-virtual/listeners/virtual-projection.listener.js +41 -3
- package/dist/plugins/devices-virtual/listeners/virtual-projection.listener.js.map +1 -1
- package/dist/plugins/devices-virtual/listeners/virtual-status.listener.js +28 -15
- package/dist/plugins/devices-virtual/listeners/virtual-status.listener.js.map +1 -1
- package/dist/plugins/devices-virtual/models/dew-point-response.model.d.ts +38 -0
- package/dist/plugins/devices-virtual/models/dew-point-response.model.js +193 -0
- package/dist/plugins/devices-virtual/models/dew-point-response.model.js.map +1 -0
- package/dist/plugins/devices-virtual/models/group-catalog.model.d.ts +26 -0
- package/dist/plugins/devices-virtual/models/group-catalog.model.js +117 -0
- package/dist/plugins/devices-virtual/models/group-catalog.model.js.map +1 -0
- package/dist/plugins/devices-virtual/models/light-group-draft.model.d.ts +28 -0
- package/dist/plugins/devices-virtual/models/light-group-draft.model.js +122 -0
- package/dist/plugins/devices-virtual/models/light-group-draft.model.js.map +1 -0
- package/dist/plugins/devices-virtual/models/measurement-authoring-response.model.d.ts +26 -0
- package/dist/plugins/devices-virtual/models/measurement-authoring-response.model.js +125 -0
- package/dist/plugins/devices-virtual/models/measurement-authoring-response.model.js.map +1 -0
- package/dist/plugins/devices-virtual/models/native-thermostat-response.model.d.ts +84 -0
- package/dist/plugins/devices-virtual/models/native-thermostat-response.model.js +406 -0
- package/dist/plugins/devices-virtual/models/native-thermostat-response.model.js.map +1 -0
- package/dist/plugins/devices-virtual/models/numeric-operator.model.d.ts +23 -0
- package/dist/plugins/devices-virtual/models/numeric-operator.model.js +120 -0
- package/dist/plugins/devices-virtual/models/numeric-operator.model.js.map +1 -0
- package/dist/plugins/devices-virtual/models/producer-response.model.d.ts +138 -0
- package/dist/plugins/devices-virtual/models/producer-response.model.js +764 -0
- package/dist/plugins/devices-virtual/models/producer-response.model.js.map +1 -0
- package/dist/plugins/devices-virtual/models/thermostat-authoring-context.model.d.ts +22 -0
- package/dist/plugins/devices-virtual/models/thermostat-authoring-context.model.js +134 -0
- package/dist/plugins/devices-virtual/models/thermostat-authoring-context.model.js.map +1 -0
- package/dist/plugins/devices-virtual/models/thermostat-authoring-response.model.d.ts +18 -0
- package/dist/plugins/devices-virtual/models/thermostat-authoring-response.model.js +87 -0
- package/dist/plugins/devices-virtual/models/thermostat-authoring-response.model.js.map +1 -0
- package/dist/plugins/devices-virtual/models/thermostat-comfort-response.model.d.ts +60 -0
- package/dist/plugins/devices-virtual/models/thermostat-comfort-response.model.js +341 -0
- package/dist/plugins/devices-virtual/models/thermostat-comfort-response.model.js.map +1 -0
- package/dist/plugins/devices-virtual/models/thermostat-installation-response.model.d.ts +84 -0
- package/dist/plugins/devices-virtual/models/thermostat-installation-response.model.js +440 -0
- package/dist/plugins/devices-virtual/models/thermostat-installation-response.model.js.map +1 -0
- package/dist/plugins/devices-virtual/models/thermostat-response.model.d.ts +218 -0
- package/dist/plugins/devices-virtual/models/thermostat-response.model.js +1157 -0
- package/dist/plugins/devices-virtual/models/thermostat-response.model.js.map +1 -0
- package/dist/plugins/devices-virtual/models/transform-response.model.d.ts +73 -0
- package/dist/plugins/devices-virtual/models/transform-response.model.js +386 -0
- package/dist/plugins/devices-virtual/models/transform-response.model.js.map +1 -0
- package/dist/plugins/devices-virtual/platforms/virtual-device.platform.d.ts +5 -1
- package/dist/plugins/devices-virtual/platforms/virtual-device.platform.js +22 -3
- package/dist/plugins/devices-virtual/platforms/virtual-device.platform.js.map +1 -1
- package/dist/plugins/devices-virtual/services/native-thermostat.service.d.ts +72 -0
- package/dist/plugins/devices-virtual/services/native-thermostat.service.js +932 -0
- package/dist/plugins/devices-virtual/services/native-thermostat.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/thermostat-authoring-context.service.d.ts +14 -0
- package/dist/plugins/devices-virtual/services/thermostat-authoring-context.service.js +147 -0
- package/dist/plugins/devices-virtual/services/thermostat-authoring-context.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/thermostat-comfort-selection.d.ts +199 -0
- package/dist/plugins/devices-virtual/services/thermostat-comfort-selection.js +1064 -0
- package/dist/plugins/devices-virtual/services/thermostat-comfort-selection.js.map +1 -0
- package/dist/plugins/devices-virtual/services/thermostat-controller-mutation.d.ts +75 -0
- package/dist/plugins/devices-virtual/services/thermostat-controller-mutation.js +445 -0
- package/dist/plugins/devices-virtual/services/thermostat-controller-mutation.js.map +1 -0
- package/dist/plugins/devices-virtual/services/thermostat-cooling-dependency.service.d.ts +53 -0
- package/dist/plugins/devices-virtual/services/thermostat-cooling-dependency.service.js +267 -0
- package/dist/plugins/devices-virtual/services/thermostat-cooling-dependency.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/thermostat-creation-catalog.d.ts +56 -0
- package/dist/plugins/devices-virtual/services/thermostat-creation-catalog.js +438 -0
- package/dist/plugins/devices-virtual/services/thermostat-creation-catalog.js.map +1 -0
- package/dist/plugins/devices-virtual/services/thermostat-creation-response.d.ts +37 -0
- package/dist/plugins/devices-virtual/services/thermostat-creation-response.js +430 -0
- package/dist/plugins/devices-virtual/services/thermostat-creation-response.js.map +1 -0
- package/dist/plugins/devices-virtual/services/thermostat-installation-artifact.d.ts +13 -0
- package/dist/plugins/devices-virtual/services/thermostat-installation-artifact.js +263 -0
- package/dist/plugins/devices-virtual/services/thermostat-installation-artifact.js.map +1 -0
- package/dist/plugins/devices-virtual/services/thermostat-installation-bindings.service.d.ts +10 -0
- package/dist/plugins/devices-virtual/services/thermostat-installation-bindings.service.js +238 -0
- package/dist/plugins/devices-virtual/services/thermostat-installation-bindings.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/thermostat-installation-loader.service.d.ts +41 -0
- package/dist/plugins/devices-virtual/services/thermostat-installation-loader.service.js +350 -0
- package/dist/plugins/devices-virtual/services/thermostat-installation-loader.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/thermostat-installation.service.d.ts +40 -0
- package/dist/plugins/devices-virtual/services/thermostat-installation.service.js +263 -0
- package/dist/plugins/devices-virtual/services/thermostat-installation.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/thermostat-installation.types.d.ts +72 -0
- package/dist/plugins/devices-virtual/services/thermostat-installation.types.js +13 -0
- package/dist/plugins/devices-virtual/services/thermostat-installation.types.js.map +1 -0
- package/dist/plugins/devices-virtual/services/thermostat-member-protection.service.d.ts +45 -0
- package/dist/plugins/devices-virtual/services/thermostat-member-protection.service.js +235 -0
- package/dist/plugins/devices-virtual/services/thermostat-member-protection.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/thermostat-override-clock.sql.d.ts +1 -0
- package/dist/plugins/devices-virtual/services/thermostat-override-clock.sql.js +16 -0
- package/dist/plugins/devices-virtual/services/thermostat-override-clock.sql.js.map +1 -0
- package/dist/plugins/devices-virtual/services/thermostat-protection-source.utils.d.ts +27 -0
- package/dist/plugins/devices-virtual/services/thermostat-protection-source.utils.js +132 -0
- package/dist/plugins/devices-virtual/services/thermostat-protection-source.utils.js.map +1 -0
- package/dist/plugins/devices-virtual/services/thermostat-remote-cooling-adapter.d.ts +88 -0
- package/dist/plugins/devices-virtual/services/thermostat-remote-cooling-adapter.js +200 -0
- package/dist/plugins/devices-virtual/services/thermostat-remote-cooling-adapter.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-aggregate-evaluator.d.ts +35 -0
- package/dist/plugins/devices-virtual/services/virtual-aggregate-evaluator.js +200 -0
- package/dist/plugins/devices-virtual/services/virtual-aggregate-evaluator.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-aggregate-policy.utils.d.ts +5 -0
- package/dist/plugins/devices-virtual/services/virtual-aggregate-policy.utils.js +18 -0
- package/dist/plugins/devices-virtual/services/virtual-aggregate-policy.utils.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-aggregate-runtime.service.d.ts +48 -0
- package/dist/plugins/devices-virtual/services/virtual-aggregate-runtime.service.js +425 -0
- package/dist/plugins/devices-virtual/services/virtual-aggregate-runtime.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-cooling-policy.utils.d.ts +13 -0
- package/dist/plugins/devices-virtual/services/virtual-cooling-policy.utils.js +38 -0
- package/dist/plugins/devices-virtual/services/virtual-cooling-policy.utils.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-cover-contract.utils.d.ts +7 -0
- package/dist/plugins/devices-virtual/services/virtual-cover-contract.utils.js +41 -0
- package/dist/plugins/devices-virtual/services/virtual-cover-contract.utils.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-cover-readiness.utils.d.ts +16 -0
- package/dist/plugins/devices-virtual/services/virtual-cover-readiness.utils.js +42 -0
- package/dist/plugins/devices-virtual/services/virtual-cover-readiness.utils.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-dependency-graph.service.d.ts +118 -0
- package/dist/plugins/devices-virtual/services/virtual-dependency-graph.service.js +667 -0
- package/dist/plugins/devices-virtual/services/virtual-dependency-graph.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-devices.service.d.ts +8 -4
- package/dist/plugins/devices-virtual/services/virtual-devices.service.js +105 -22
- package/dist/plugins/devices-virtual/services/virtual-devices.service.js.map +1 -1
- package/dist/plugins/devices-virtual/services/virtual-dew-point-config.service.d.ts +28 -0
- package/dist/plugins/devices-virtual/services/virtual-dew-point-config.service.js +193 -0
- package/dist/plugins/devices-virtual/services/virtual-dew-point-config.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-dew-point-contract.utils.d.ts +5 -0
- package/dist/plugins/devices-virtual/services/virtual-dew-point-contract.utils.js +69 -0
- package/dist/plugins/devices-virtual/services/virtual-dew-point-contract.utils.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-dew-point-runtime.service.d.ts +65 -0
- package/dist/plugins/devices-virtual/services/virtual-dew-point-runtime.service.js +524 -0
- package/dist/plugins/devices-virtual/services/virtual-dew-point-runtime.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-dew-point.utils.d.ts +9 -0
- package/dist/plugins/devices-virtual/services/virtual-dew-point.utils.js +25 -0
- package/dist/plugins/devices-virtual/services/virtual-dew-point.utils.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-group-catalog.service.d.ts +10 -0
- package/dist/plugins/devices-virtual/services/virtual-group-catalog.service.js +117 -0
- package/dist/plugins/devices-virtual/services/virtual-group-catalog.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-group-contract.utils.d.ts +4 -0
- package/dist/plugins/devices-virtual/services/virtual-group-contract.utils.js +35 -0
- package/dist/plugins/devices-virtual/services/virtual-group-contract.utils.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-group-field.utils.d.ts +10 -0
- package/dist/plugins/devices-virtual/services/virtual-group-field.utils.js +35 -0
- package/dist/plugins/devices-virtual/services/virtual-group-field.utils.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-group-profile.d.ts +19 -0
- package/dist/plugins/devices-virtual/services/virtual-group-profile.js +137 -0
- package/dist/plugins/devices-virtual/services/virtual-group-profile.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-light-group-authoring.service.d.ts +43 -0
- package/dist/plugins/devices-virtual/services/virtual-light-group-authoring.service.js +217 -0
- package/dist/plugins/devices-virtual/services/virtual-light-group-authoring.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-light-group-command.service.d.ts +28 -0
- package/dist/plugins/devices-virtual/services/virtual-light-group-command.service.js +262 -0
- package/dist/plugins/devices-virtual/services/virtual-light-group-command.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-light-group-contribution.service.d.ts +19 -0
- package/dist/plugins/devices-virtual/services/virtual-light-group-contribution.service.js +91 -0
- package/dist/plugins/devices-virtual/services/virtual-light-group-contribution.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-light-group-state.service.d.ts +37 -0
- package/dist/plugins/devices-virtual/services/virtual-light-group-state.service.js +346 -0
- package/dist/plugins/devices-virtual/services/virtual-light-group-state.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-light-group.utils.d.ts +46 -0
- package/dist/plugins/devices-virtual/services/virtual-light-group.utils.js +204 -0
- package/dist/plugins/devices-virtual/services/virtual-light-group.utils.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-measurement-authoring.service.d.ts +37 -0
- package/dist/plugins/devices-virtual/services/virtual-measurement-authoring.service.js +270 -0
- package/dist/plugins/devices-virtual/services/virtual-measurement-authoring.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-measurement-contribution.service.d.ts +21 -0
- package/dist/plugins/devices-virtual/services/virtual-measurement-contribution.service.js +166 -0
- package/dist/plugins/devices-virtual/services/virtual-measurement-contribution.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-measurement-metadata.utils.d.ts +3 -0
- package/dist/plugins/devices-virtual/services/virtual-measurement-metadata.utils.js +25 -0
- package/dist/plugins/devices-virtual/services/virtual-measurement-metadata.utils.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-numeric-operator-host.service.d.ts +24 -0
- package/dist/plugins/devices-virtual/services/virtual-numeric-operator-host.service.js +145 -0
- package/dist/plugins/devices-virtual/services/virtual-numeric-operator-host.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-numeric-operator.registry.d.ts +18 -0
- package/dist/plugins/devices-virtual/services/virtual-numeric-operator.registry.js +86 -0
- package/dist/plugins/devices-virtual/services/virtual-numeric-operator.registry.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-numeric-profile.utils.d.ts +29 -0
- package/dist/plugins/devices-virtual/services/virtual-numeric-profile.utils.js +136 -0
- package/dist/plugins/devices-virtual/services/virtual-numeric-profile.utils.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-numeric-transform.utils.d.ts +59 -0
- package/dist/plugins/devices-virtual/services/virtual-numeric-transform.utils.js +165 -0
- package/dist/plugins/devices-virtual/services/virtual-numeric-transform.utils.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-producer-config.service.d.ts +64 -0
- package/dist/plugins/devices-virtual/services/virtual-producer-config.service.js +694 -0
- package/dist/plugins/devices-virtual/services/virtual-producer-config.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-producer-state.service.d.ts +60 -0
- package/dist/plugins/devices-virtual/services/virtual-producer-state.service.js +484 -0
- package/dist/plugins/devices-virtual/services/virtual-producer-state.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-property-index.service.d.ts +11 -2
- package/dist/plugins/devices-virtual/services/virtual-property-index.service.js +166 -13
- package/dist/plugins/devices-virtual/services/virtual-property-index.service.js.map +1 -1
- package/dist/plugins/devices-virtual/services/virtual-source-eligibility.utils.d.ts +3 -0
- package/dist/plugins/devices-virtual/services/virtual-source-eligibility.utils.js +10 -0
- package/dist/plugins/devices-virtual/services/virtual-source-eligibility.utils.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-authoring.service.d.ts +27 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-authoring.service.js +385 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-authoring.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-automation.service.d.ts +90 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-automation.service.js +1189 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-automation.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-branch.utils.d.ts +5 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-branch.utils.js +29 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-branch.utils.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-claims.service.d.ts +80 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-claims.service.js +489 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-claims.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-comfort.service.d.ts +80 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-comfort.service.js +580 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-comfort.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-comfort.utils.d.ts +58 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-comfort.utils.js +106 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-comfort.utils.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-config.service.d.ts +909 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-config.service.js +1171 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-config.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-contract.utils.d.ts +5 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-contract.utils.js +51 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-contract.utils.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-inputs.service.d.ts +46 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-inputs.service.js +166 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-inputs.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-ownership.sql.d.ts +4 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-ownership.sql.js +59 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-ownership.sql.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-policy.utils.d.ts +45 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-policy.utils.js +149 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-policy.utils.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-runtime-ownership.d.ts +56 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-runtime-ownership.js +680 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-runtime-ownership.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-runtime.service.d.ts +133 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-runtime.service.js +1617 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-runtime.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-transport.service.d.ts +39 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-transport.service.js +561 -0
- package/dist/plugins/devices-virtual/services/virtual-thermostat-transport.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-transform-config.service.d.ts +41 -0
- package/dist/plugins/devices-virtual/services/virtual-transform-config.service.js +209 -0
- package/dist/plugins/devices-virtual/services/virtual-transform-config.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-transform-contract.utils.d.ts +8 -0
- package/dist/plugins/devices-virtual/services/virtual-transform-contract.utils.js +103 -0
- package/dist/plugins/devices-virtual/services/virtual-transform-contract.utils.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-transform-preview.utils.d.ts +3 -0
- package/dist/plugins/devices-virtual/services/virtual-transform-preview.utils.js +18 -0
- package/dist/plugins/devices-virtual/services/virtual-transform-preview.utils.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-transform-resolver.d.ts +15 -0
- package/dist/plugins/devices-virtual/services/virtual-transform-resolver.js +102 -0
- package/dist/plugins/devices-virtual/services/virtual-transform-resolver.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-transform-runtime.service.d.ts +54 -0
- package/dist/plugins/devices-virtual/services/virtual-transform-runtime.service.js +470 -0
- package/dist/plugins/devices-virtual/services/virtual-transform-runtime.service.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-typed-group.utils.d.ts +6 -0
- package/dist/plugins/devices-virtual/services/virtual-typed-group.utils.js +100 -0
- package/dist/plugins/devices-virtual/services/virtual-typed-group.utils.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-value-source.service.d.ts +7 -0
- package/dist/plugins/devices-virtual/services/virtual-value-source.service.js +36 -2
- package/dist/plugins/devices-virtual/services/virtual-value-source.service.js.map +1 -1
- package/dist/plugins/devices-virtual/services/virtual-window-contact.utils.d.ts +17 -0
- package/dist/plugins/devices-virtual/services/virtual-window-contact.utils.js +52 -0
- package/dist/plugins/devices-virtual/services/virtual-window-contact.utils.js.map +1 -0
- package/dist/plugins/devices-virtual/services/virtual-window-trend.utils.d.ts +44 -0
- package/dist/plugins/devices-virtual/services/virtual-window-trend.utils.js +171 -0
- package/dist/plugins/devices-virtual/services/virtual-window-trend.utils.js.map +1 -0
- package/dist/plugins/devices-virtual/subscribers/virtual-thermostat-ownership.subscriber.d.ts +30 -0
- package/dist/plugins/devices-virtual/subscribers/virtual-thermostat-ownership.subscriber.js +195 -0
- package/dist/plugins/devices-virtual/subscribers/virtual-thermostat-ownership.subscriber.js.map +1 -0
- package/dist/plugins/devices-virtual/subscribers/virtual-transform-metadata.subscriber.d.ts +9 -0
- package/dist/plugins/devices-virtual/subscribers/virtual-transform-metadata.subscriber.js +58 -0
- package/dist/plugins/devices-virtual/subscribers/virtual-transform-metadata.subscriber.js.map +1 -0
- package/dist/plugins/devices-virtual/validators/category-allowed-constraint.validator.d.ts +1 -1
- package/dist/plugins/devices-virtual/validators/category-allowed-constraint.validator.js +6 -1
- package/dist/plugins/devices-virtual/validators/category-allowed-constraint.validator.js.map +1 -1
- package/dist/plugins/devices-wled/interfaces/wled.interface.d.ts +7 -0
- package/dist/plugins/devices-wled/interfaces/wled.interface.js.map +1 -1
- package/dist/plugins/devices-wled/platforms/wled.device.platform.d.ts +4 -2
- package/dist/plugins/devices-wled/platforms/wled.device.platform.js +56 -9
- package/dist/plugins/devices-wled/platforms/wled.device.platform.js.map +1 -1
- package/dist/plugins/devices-wled/services/device-mapper.service.d.ts +3 -2
- package/dist/plugins/devices-wled/services/device-mapper.service.js +48 -1
- package/dist/plugins/devices-wled/services/device-mapper.service.js.map +1 -1
- package/dist/plugins/devices-wled/services/wled-client-adapter.service.d.ts +6 -1
- package/dist/plugins/devices-wled/services/wled-client-adapter.service.js +101 -13
- package/dist/plugins/devices-wled/services/wled-client-adapter.service.js.map +1 -1
- package/dist/plugins/devices-wled/services/wled.service.js +5 -2
- package/dist/plugins/devices-wled/services/wled.service.js.map +1 -1
- package/dist/plugins/devices-zigbee2mqtt/contracts/sample-source.contract.d.ts +38 -0
- package/dist/plugins/devices-zigbee2mqtt/contracts/sample-source.contract.js +95 -0
- package/dist/plugins/devices-zigbee2mqtt/contracts/sample-source.contract.js.map +1 -0
- package/dist/plugins/devices-zigbee2mqtt/devices-zigbee2mqtt.plugin.js +11 -1
- package/dist/plugins/devices-zigbee2mqtt/devices-zigbee2mqtt.plugin.js.map +1 -1
- package/dist/plugins/devices-zigbee2mqtt/entities/zigbee-sample-source.entity.d.ts +18 -0
- package/dist/plugins/devices-zigbee2mqtt/entities/zigbee-sample-source.entity.js +79 -0
- package/dist/plugins/devices-zigbee2mqtt/entities/zigbee-sample-source.entity.js.map +1 -0
- package/dist/plugins/devices-zigbee2mqtt/interfaces/zigbee2mqtt.interface.d.ts +11 -0
- package/dist/plugins/devices-zigbee2mqtt/platforms/zigbee2mqtt.device.platform.d.ts +11 -2
- package/dist/plugins/devices-zigbee2mqtt/platforms/zigbee2mqtt.device.platform.js +100 -11
- package/dist/plugins/devices-zigbee2mqtt/platforms/zigbee2mqtt.device.platform.js.map +1 -1
- package/dist/plugins/devices-zigbee2mqtt/services/base-client-adapter.d.ts +31 -13
- package/dist/plugins/devices-zigbee2mqtt/services/base-client-adapter.js +166 -5
- package/dist/plugins/devices-zigbee2mqtt/services/base-client-adapter.js.map +1 -1
- package/dist/plugins/devices-zigbee2mqtt/services/device-adoption.service.d.ts +1 -0
- package/dist/plugins/devices-zigbee2mqtt/services/device-adoption.service.js +44 -3
- package/dist/plugins/devices-zigbee2mqtt/services/device-adoption.service.js.map +1 -1
- package/dist/plugins/devices-zigbee2mqtt/services/device-mapper.service.d.ts +20 -3
- package/dist/plugins/devices-zigbee2mqtt/services/device-mapper.service.js +156 -34
- package/dist/plugins/devices-zigbee2mqtt/services/device-mapper.service.js.map +1 -1
- package/dist/plugins/devices-zigbee2mqtt/services/mqtt-client-adapter.service.d.ts +1 -1
- package/dist/plugins/devices-zigbee2mqtt/services/mqtt-client-adapter.service.js +14 -1
- package/dist/plugins/devices-zigbee2mqtt/services/mqtt-client-adapter.service.js.map +1 -1
- package/dist/plugins/devices-zigbee2mqtt/services/native-climate-adapter.service.d.ts +15 -0
- package/dist/plugins/devices-zigbee2mqtt/services/native-climate-adapter.service.js +249 -0
- package/dist/plugins/devices-zigbee2mqtt/services/native-climate-adapter.service.js.map +1 -0
- package/dist/plugins/devices-zigbee2mqtt/services/websocket-sample-evidence.d.ts +2 -0
- package/dist/plugins/devices-zigbee2mqtt/services/websocket-sample-evidence.js +15 -0
- package/dist/plugins/devices-zigbee2mqtt/services/websocket-sample-evidence.js.map +1 -0
- package/dist/plugins/devices-zigbee2mqtt/services/ws-client-adapter.service.d.ts +7 -1
- package/dist/plugins/devices-zigbee2mqtt/services/ws-client-adapter.service.js +45 -2
- package/dist/plugins/devices-zigbee2mqtt/services/ws-client-adapter.service.js.map +1 -1
- package/dist/plugins/devices-zigbee2mqtt/services/zigbee-sample-sources.service.d.ts +49 -0
- package/dist/plugins/devices-zigbee2mqtt/services/zigbee-sample-sources.service.js +264 -0
- package/dist/plugins/devices-zigbee2mqtt/services/zigbee-sample-sources.service.js.map +1 -0
- package/dist/plugins/devices-zigbee2mqtt/services/zigbee2mqtt.service.js +2 -0
- package/dist/plugins/devices-zigbee2mqtt/services/zigbee2mqtt.service.js.map +1 -1
- package/dist/plugins/scenes-local/platforms/local-scene.platform.d.ts +6 -3
- package/dist/plugins/scenes-local/platforms/local-scene.platform.js +101 -15
- package/dist/plugins/scenes-local/platforms/local-scene.platform.js.map +1 -1
- package/dist/plugins/spaces-home-control/activity/activity-actor.d.ts +2 -0
- package/dist/plugins/spaces-home-control/activity/activity-actor.js +14 -0
- package/dist/plugins/spaces-home-control/activity/activity-actor.js.map +1 -0
- package/dist/plugins/spaces-home-control/activity/activity-result.utils.d.ts +6 -0
- package/dist/plugins/spaces-home-control/activity/activity-result.utils.js +26 -0
- package/dist/plugins/spaces-home-control/activity/activity-result.utils.js.map +1 -0
- package/dist/plugins/spaces-home-control/activity/space-activity.constants.d.ts +32 -0
- package/dist/plugins/spaces-home-control/activity/space-activity.constants.js +40 -0
- package/dist/plugins/spaces-home-control/activity/space-activity.constants.js.map +1 -0
- package/dist/plugins/spaces-home-control/activity/space-activity.defaults.d.ts +3 -0
- package/dist/plugins/spaces-home-control/activity/space-activity.defaults.js +25 -0
- package/dist/plugins/spaces-home-control/activity/space-activity.defaults.js.map +1 -0
- package/dist/plugins/spaces-home-control/activity/validate-activity-configuration.d.ts +2 -0
- package/dist/plugins/spaces-home-control/activity/validate-activity-configuration.js +37 -0
- package/dist/plugins/spaces-home-control/activity/validate-activity-configuration.js.map +1 -0
- package/dist/plugins/spaces-home-control/controllers/space-mode-schedules.controller.d.ts +12 -0
- package/dist/plugins/spaces-home-control/controllers/space-mode-schedules.controller.js +97 -0
- package/dist/plugins/spaces-home-control/controllers/space-mode-schedules.controller.js.map +1 -0
- package/dist/plugins/spaces-home-control/controllers/space-modes.controller.d.ts +19 -0
- package/dist/plugins/spaces-home-control/controllers/space-modes.controller.js +220 -0
- package/dist/plugins/spaces-home-control/controllers/space-modes.controller.js.map +1 -0
- package/dist/plugins/spaces-home-control/controllers/space-occupancy.controller.d.ts +18 -0
- package/dist/plugins/spaces-home-control/controllers/space-occupancy.controller.js +147 -0
- package/dist/plugins/spaces-home-control/controllers/space-occupancy.controller.js.map +1 -0
- package/dist/plugins/spaces-home-control/controllers/spaces-domain.controller.js +4 -0
- package/dist/plugins/spaces-home-control/controllers/spaces-domain.controller.js.map +1 -1
- package/dist/plugins/spaces-home-control/dto/activity-mode.dto.d.ts +22 -0
- package/dist/plugins/spaces-home-control/dto/activity-mode.dto.js +119 -0
- package/dist/plugins/spaces-home-control/dto/activity-mode.dto.js.map +1 -0
- package/dist/plugins/spaces-home-control/dto/space-mode-schedule.dto.d.ts +18 -0
- package/dist/plugins/spaces-home-control/dto/space-mode-schedule.dto.js +127 -0
- package/dist/plugins/spaces-home-control/dto/space-mode-schedule.dto.js.map +1 -0
- package/dist/plugins/spaces-home-control/dto/space-occupancy.dto.d.ts +13 -0
- package/dist/plugins/spaces-home-control/dto/space-occupancy.dto.js +99 -0
- package/dist/plugins/spaces-home-control/dto/space-occupancy.dto.js.map +1 -0
- package/dist/plugins/spaces-home-control/entities/space-activity-config.entity.d.ts +12 -0
- package/dist/plugins/spaces-home-control/entities/space-activity-config.entity.js +72 -0
- package/dist/plugins/spaces-home-control/entities/space-activity-config.entity.js.map +1 -0
- package/dist/plugins/spaces-home-control/entities/space-activity-state.entity.d.ts +14 -0
- package/dist/plugins/spaces-home-control/entities/space-activity-state.entity.js +105 -0
- package/dist/plugins/spaces-home-control/entities/space-activity-state.entity.js.map +1 -0
- package/dist/plugins/spaces-home-control/entities/space-mode-schedule.entity.d.ts +19 -0
- package/dist/plugins/spaces-home-control/entities/space-mode-schedule.entity.js +110 -0
- package/dist/plugins/spaces-home-control/entities/space-mode-schedule.entity.js.map +1 -0
- package/dist/plugins/spaces-home-control/entities/space-occupancy.entity.d.ts +23 -0
- package/dist/plugins/spaces-home-control/entities/space-occupancy.entity.js +135 -0
- package/dist/plugins/spaces-home-control/entities/space-occupancy.entity.js.map +1 -0
- package/dist/plugins/spaces-home-control/listeners/space-climate-state.listener.d.ts +2 -0
- package/dist/plugins/spaces-home-control/listeners/space-climate-state.listener.js +23 -0
- package/dist/plugins/spaces-home-control/listeners/space-climate-state.listener.js.map +1 -1
- package/dist/plugins/spaces-home-control/listeners/websocket-exchange.listener.js +3 -0
- package/dist/plugins/spaces-home-control/listeners/websocket-exchange.listener.js.map +1 -1
- package/dist/plugins/spaces-home-control/models/activity-configuration.model.d.ts +27 -0
- package/dist/plugins/spaces-home-control/models/activity-configuration.model.js +182 -0
- package/dist/plugins/spaces-home-control/models/activity-configuration.model.js.map +1 -0
- package/dist/plugins/spaces-home-control/models/activity-response.model.d.ts +16 -0
- package/dist/plugins/spaces-home-control/models/activity-response.model.js +79 -0
- package/dist/plugins/spaces-home-control/models/activity-response.model.js.map +1 -0
- package/dist/plugins/spaces-home-control/models/activity-result.model.d.ts +6 -0
- package/dist/plugins/spaces-home-control/models/activity-result.model.js +37 -0
- package/dist/plugins/spaces-home-control/models/activity-result.model.js.map +1 -0
- package/dist/plugins/spaces-home-control/models/climate-contribution.model.d.ts +11 -0
- package/dist/plugins/spaces-home-control/models/climate-contribution.model.js +66 -0
- package/dist/plugins/spaces-home-control/models/climate-contribution.model.js.map +1 -0
- package/dist/plugins/spaces-home-control/models/space-mode-schedule-response.model.d.ts +9 -0
- package/dist/plugins/spaces-home-control/models/space-mode-schedule-response.model.js +45 -0
- package/dist/plugins/spaces-home-control/models/space-mode-schedule-response.model.js.map +1 -0
- package/dist/plugins/spaces-home-control/models/space-mode-schedule.model.d.ts +34 -0
- package/dist/plugins/spaces-home-control/models/space-mode-schedule.model.js +170 -0
- package/dist/plugins/spaces-home-control/models/space-mode-schedule.model.js.map +1 -0
- package/dist/plugins/spaces-home-control/models/space-occupancy.model.d.ts +26 -0
- package/dist/plugins/spaces-home-control/models/space-occupancy.model.js +121 -0
- package/dist/plugins/spaces-home-control/models/space-occupancy.model.js.map +1 -0
- package/dist/plugins/spaces-home-control/models/spaces-response.model.d.ts +13 -0
- package/dist/plugins/spaces-home-control/models/spaces-response.model.js +81 -2
- package/dist/plugins/spaces-home-control/models/spaces-response.model.js.map +1 -1
- package/dist/plugins/spaces-home-control/occupancy/occupancy-admission.d.ts +7 -0
- package/dist/plugins/spaces-home-control/occupancy/occupancy-admission.js +57 -0
- package/dist/plugins/spaces-home-control/occupancy/occupancy-admission.js.map +1 -0
- package/dist/plugins/spaces-home-control/occupancy/space-occupancy.types.d.ts +31 -0
- package/dist/plugins/spaces-home-control/occupancy/space-occupancy.types.js +30 -0
- package/dist/plugins/spaces-home-control/occupancy/space-occupancy.types.js.map +1 -0
- package/dist/plugins/spaces-home-control/schedule/schedule-time.d.ts +9 -0
- package/dist/plugins/spaces-home-control/schedule/schedule-time.js +79 -0
- package/dist/plugins/spaces-home-control/schedule/schedule-time.js.map +1 -0
- package/dist/plugins/spaces-home-control/schedule/space-mode-schedule.types.d.ts +28 -0
- package/dist/plugins/spaces-home-control/schedule/space-mode-schedule.types.js +7 -0
- package/dist/plugins/spaces-home-control/schedule/space-mode-schedule.types.js.map +1 -0
- package/dist/plugins/spaces-home-control/services/activity-test-support.d.ts +16 -0
- package/dist/plugins/spaces-home-control/services/activity-test-support.js +34 -0
- package/dist/plugins/spaces-home-control/services/activity-test-support.js.map +1 -0
- package/dist/plugins/spaces-home-control/services/climate-contribution-planner.service.d.ts +15 -0
- package/dist/plugins/spaces-home-control/services/climate-contribution-planner.service.js +97 -0
- package/dist/plugins/spaces-home-control/services/climate-contribution-planner.service.js.map +1 -0
- package/dist/plugins/spaces-home-control/services/climate-intent.service.d.ts +15 -2
- package/dist/plugins/spaces-home-control/services/climate-intent.service.js +155 -15
- package/dist/plugins/spaces-home-control/services/climate-intent.service.js.map +1 -1
- package/dist/plugins/spaces-home-control/services/cover-group-intent.port.d.ts +31 -0
- package/dist/plugins/spaces-home-control/services/cover-group-intent.port.js +189 -0
- package/dist/plugins/spaces-home-control/services/cover-group-intent.port.js.map +1 -0
- package/dist/plugins/spaces-home-control/services/covers-intent.service.d.ts +8 -3
- package/dist/plugins/spaces-home-control/services/covers-intent.service.js +139 -65
- package/dist/plugins/spaces-home-control/services/covers-intent.service.js.map +1 -1
- package/dist/plugins/spaces-home-control/services/lighting-contribution-planner.service.d.ts +16 -0
- package/dist/plugins/spaces-home-control/services/lighting-contribution-planner.service.js +66 -0
- package/dist/plugins/spaces-home-control/services/lighting-contribution-planner.service.js.map +1 -0
- package/dist/plugins/spaces-home-control/services/lighting-intent.service.d.ts +13 -3
- package/dist/plugins/spaces-home-control/services/lighting-intent.service.js +93 -13
- package/dist/plugins/spaces-home-control/services/lighting-intent.service.js.map +1 -1
- package/dist/plugins/spaces-home-control/services/space-activity-config.service.d.ts +25 -0
- package/dist/plugins/spaces-home-control/services/space-activity-config.service.js +144 -0
- package/dist/plugins/spaces-home-control/services/space-activity-config.service.js.map +1 -0
- package/dist/plugins/spaces-home-control/services/space-activity-domains.service.d.ts +21 -0
- package/dist/plugins/spaces-home-control/services/space-activity-domains.service.js +139 -0
- package/dist/plugins/spaces-home-control/services/space-activity-domains.service.js.map +1 -0
- package/dist/plugins/spaces-home-control/services/space-climate-automation.port.d.ts +17 -0
- package/dist/plugins/spaces-home-control/services/space-climate-automation.port.js +5 -0
- package/dist/plugins/spaces-home-control/services/space-climate-automation.port.js.map +1 -0
- package/dist/plugins/spaces-home-control/services/space-climate-automation.service.d.ts +63 -0
- package/dist/plugins/spaces-home-control/services/space-climate-automation.service.js +722 -0
- package/dist/plugins/spaces-home-control/services/space-climate-automation.service.js.map +1 -0
- package/dist/plugins/spaces-home-control/services/space-climate-state.service.d.ts +8 -3
- package/dist/plugins/spaces-home-control/services/space-climate-state.service.js +25 -19
- package/dist/plugins/spaces-home-control/services/space-climate-state.service.js.map +1 -1
- package/dist/plugins/spaces-home-control/services/space-covers-state.service.d.ts +16 -2
- package/dist/plugins/spaces-home-control/services/space-covers-state.service.js +102 -18
- package/dist/plugins/spaces-home-control/services/space-covers-state.service.js.map +1 -1
- package/dist/plugins/spaces-home-control/services/space-intent-base.service.d.ts +2 -0
- package/dist/plugins/spaces-home-control/services/space-intent-base.service.js.map +1 -1
- package/dist/plugins/spaces-home-control/services/space-lighting-state.service.d.ts +4 -1
- package/dist/plugins/spaces-home-control/services/space-lighting-state.service.js +94 -24
- 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 +8 -2
- package/dist/plugins/spaces-home-control/services/space-media-activity.service.js +79 -13
- package/dist/plugins/spaces-home-control/services/space-media-activity.service.js.map +1 -1
- package/dist/plugins/spaces-home-control/services/space-mode-schedule-config.service.d.ts +24 -0
- package/dist/plugins/spaces-home-control/services/space-mode-schedule-config.service.js +132 -0
- package/dist/plugins/spaces-home-control/services/space-mode-schedule-config.service.js.map +1 -0
- package/dist/plugins/spaces-home-control/services/space-mode-scheduler.service.d.ts +39 -0
- package/dist/plugins/spaces-home-control/services/space-mode-scheduler.service.js +289 -0
- package/dist/plugins/spaces-home-control/services/space-mode-scheduler.service.js.map +1 -0
- package/dist/plugins/spaces-home-control/services/space-mode.service.d.ts +34 -0
- package/dist/plugins/spaces-home-control/services/space-mode.service.js +296 -0
- package/dist/plugins/spaces-home-control/services/space-mode.service.js.map +1 -0
- package/dist/plugins/spaces-home-control/services/space-occupancy-config.service.d.ts +26 -0
- package/dist/plugins/spaces-home-control/services/space-occupancy-config.service.js +134 -0
- package/dist/plugins/spaces-home-control/services/space-occupancy-config.service.js.map +1 -0
- package/dist/plugins/spaces-home-control/services/space-occupancy-inputs.service.d.ts +21 -0
- package/dist/plugins/spaces-home-control/services/space-occupancy-inputs.service.js +84 -0
- package/dist/plugins/spaces-home-control/services/space-occupancy-inputs.service.js.map +1 -0
- package/dist/plugins/spaces-home-control/services/space-occupancy.service.d.ts +48 -0
- package/dist/plugins/spaces-home-control/services/space-occupancy.service.js +285 -0
- package/dist/plugins/spaces-home-control/services/space-occupancy.service.js.map +1 -0
- package/dist/plugins/spaces-home-control/services/space-state-read.service.d.ts +5 -1
- package/dist/plugins/spaces-home-control/services/space-state-read.service.js +33 -7
- package/dist/plugins/spaces-home-control/services/space-state-read.service.js.map +1 -1
- package/dist/plugins/spaces-home-control/spaces-home-control.openapi.js +52 -0
- package/dist/plugins/spaces-home-control/spaces-home-control.openapi.js.map +1 -1
- package/dist/plugins/spaces-home-control/spaces-home-control.plugin.d.ts +5 -1
- package/dist/plugins/spaces-home-control/spaces-home-control.plugin.js +57 -2
- package/dist/plugins/spaces-home-control/spaces-home-control.plugin.js.map +1 -1
- package/dist/spec/channels.d.ts +27 -4
- package/dist/spec/channels.js +37 -6
- package/dist/spec/channels.js.map +1 -1
- package/dist/spec/devices.d.ts +20 -0
- package/dist/spec/devices.js +20 -0
- package/dist/spec/devices.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -3
|
@@ -0,0 +1,1189 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.VirtualThermostatAutomationService = exports.THERMOSTAT_AUTOMATION_PROVIDER = void 0;
|
|
16
|
+
const class_validator_1 = require("class-validator");
|
|
17
|
+
const typeorm_1 = require("typeorm");
|
|
18
|
+
const common_1 = require("@nestjs/common");
|
|
19
|
+
const sqlite_data_source_1 = require("../../../common/database/sqlite-data-source");
|
|
20
|
+
const devices_constants_1 = require("../../../modules/devices/devices.constants");
|
|
21
|
+
const devices_exceptions_1 = require("../../../modules/devices/devices.exceptions");
|
|
22
|
+
const climate_automation_entity_1 = require("../../../modules/devices/entities/climate-automation.entity");
|
|
23
|
+
const climate_automation_ledger_service_1 = require("../../../modules/devices/services/climate-automation-ledger.service");
|
|
24
|
+
const climate_automation_ledger_utils_1 = require("../../../modules/devices/services/climate-automation-ledger.utils");
|
|
25
|
+
const climate_automation_registry_service_1 = require("../../../modules/devices/services/climate-automation.registry.service");
|
|
26
|
+
const controller_publication_context_1 = require("../../../modules/devices/services/controller-publication-context");
|
|
27
|
+
const creation_capture_1 = require("../../../modules/devices/services/creation-capture");
|
|
28
|
+
const device_structure_lock_service_1 = require("../../../modules/devices/services/device-structure-lock.service");
|
|
29
|
+
const devices_virtual_entity_1 = require("../entities/devices-virtual.entity");
|
|
30
|
+
const virtual_thermostat_entity_1 = require("../entities/virtual-thermostat.entity");
|
|
31
|
+
const thermostat_controller_mutation_1 = require("./thermostat-controller-mutation");
|
|
32
|
+
const virtual_dependency_graph_service_1 = require("./virtual-dependency-graph.service");
|
|
33
|
+
const virtual_thermostat_comfort_utils_1 = require("./virtual-thermostat-comfort.utils");
|
|
34
|
+
const virtual_thermostat_ownership_sql_1 = require("./virtual-thermostat-ownership.sql");
|
|
35
|
+
const virtual_thermostat_runtime_ownership_1 = require("./virtual-thermostat-runtime-ownership");
|
|
36
|
+
exports.THERMOSTAT_AUTOMATION_PROVIDER = 'virtual-thermostat:v1';
|
|
37
|
+
const asJson = (value) => JSON.parse(JSON.stringify(value));
|
|
38
|
+
const fail = () => {
|
|
39
|
+
throw new devices_exceptions_1.DevicesValidationException('Thermostat automation provenance or selection is unavailable.');
|
|
40
|
+
};
|
|
41
|
+
let VirtualThermostatAutomationService = class VirtualThermostatAutomationService {
|
|
42
|
+
constructor(database, registry, ledger, graph, structure) {
|
|
43
|
+
this.database = database;
|
|
44
|
+
this.registry = registry;
|
|
45
|
+
this.ledger = ledger;
|
|
46
|
+
this.graph = graph;
|
|
47
|
+
this.structure = structure;
|
|
48
|
+
this.graphRenewals = new WeakMap();
|
|
49
|
+
this.mutationVacancies = new Map();
|
|
50
|
+
this.mutationCohorts = new Map();
|
|
51
|
+
this.installations = new Map();
|
|
52
|
+
this.localAdmissions = new Map();
|
|
53
|
+
this.removedPredecessors = new WeakMap();
|
|
54
|
+
this.generationAdmissions = new Map();
|
|
55
|
+
this.retiringGenerations = new Map();
|
|
56
|
+
this.destroyed = false;
|
|
57
|
+
this.provider = {
|
|
58
|
+
beginControllerDeletion: (expected) => {
|
|
59
|
+
const installed = this.installations.get(expected.controllerId);
|
|
60
|
+
if (installed && installed.slot !== (0, climate_automation_ledger_utils_1.canonical)(expected))
|
|
61
|
+
fail();
|
|
62
|
+
const original = installed ?? this.mutationCohorts.get(expected.generationId)?.group.get(expected.controllerId);
|
|
63
|
+
if (!original)
|
|
64
|
+
return this.beginMutation(expected.controllerId);
|
|
65
|
+
if (original.slot !== (0, climate_automation_ledger_utils_1.canonical)(expected))
|
|
66
|
+
fail();
|
|
67
|
+
const source = JSON.parse(original.source);
|
|
68
|
+
return this.beginSourceMutation(source.producerKey, source.subjectId, source.generationId);
|
|
69
|
+
},
|
|
70
|
+
readDeletionConfigurationInManager: async (manager, id) => {
|
|
71
|
+
await this.assertDeletionSchema(manager);
|
|
72
|
+
const rows = await manager.query('SELECT * FROM "devices_virtual_thermostat_configs" WHERE "controllerId" = ?', [id]);
|
|
73
|
+
if (rows.length !== 1)
|
|
74
|
+
fail();
|
|
75
|
+
return { ...rows[0] };
|
|
76
|
+
},
|
|
77
|
+
readDeletedControllerInManager: async (manager, id, before) => {
|
|
78
|
+
await this.assertDeletionSchema(manager);
|
|
79
|
+
const original = before.evidence.image;
|
|
80
|
+
const retained = {
|
|
81
|
+
...original,
|
|
82
|
+
configuration: original.configuration.map((row) => ({ ...row, ownerDeviceId: null })),
|
|
83
|
+
settings: [],
|
|
84
|
+
properties: [],
|
|
85
|
+
};
|
|
86
|
+
await this.validateDeletedController(manager, id, asJson(retained));
|
|
87
|
+
return asJson(retained);
|
|
88
|
+
},
|
|
89
|
+
validateDeletedControllerInManager: (manager, id, retained) => this.validateDeletedController(manager, id, retained),
|
|
90
|
+
captureControllerRecreationArchiveInManager: async (manager, id, retained) => {
|
|
91
|
+
await this.validateDeletedController(manager, id, retained);
|
|
92
|
+
return asJson({ controller: retained, history: await (0, virtual_thermostat_runtime_ownership_1.readThermostatRecreationHistory)(manager, id) });
|
|
93
|
+
},
|
|
94
|
+
prepareControllerRecreationInManager: async (manager, id, retained, archive) => {
|
|
95
|
+
await this.validateDeletedController(manager, id, retained);
|
|
96
|
+
const original = await (0, thermostat_controller_mutation_1.readControllerMutationImage)(manager, id);
|
|
97
|
+
if ((0, climate_automation_ledger_utils_1.canonical)(original) !== (0, climate_automation_ledger_utils_1.canonical)(retained))
|
|
98
|
+
fail();
|
|
99
|
+
const captured = archive;
|
|
100
|
+
if ((0, climate_automation_ledger_utils_1.canonical)(captured.controller) !== (0, climate_automation_ledger_utils_1.canonical)(original))
|
|
101
|
+
fail();
|
|
102
|
+
const row = await manager.findOneByOrFail(virtual_thermostat_entity_1.VirtualThermostatConfigEntity, { controllerId: id });
|
|
103
|
+
const nextRevision = (0, climate_automation_ledger_utils_1.increment)(row.revision);
|
|
104
|
+
row.revision = nextRevision;
|
|
105
|
+
const history = await (0, virtual_thermostat_runtime_ownership_1.resetThermostatRecreationRuntime)(manager, id, captured.history, original.claims, nextRevision);
|
|
106
|
+
row.comfort = null;
|
|
107
|
+
row.locked = false;
|
|
108
|
+
row.releaseRequestedAt = null;
|
|
109
|
+
const configuration = await (0, thermostat_controller_mutation_1.writeControllerPartition)(manager, 'configuration', original.configuration, [row]);
|
|
110
|
+
const sources = await (0, thermostat_controller_mutation_1.writeControllerPartition)(manager, 'sources', original.sources, []);
|
|
111
|
+
const image = { ...original, configuration, sources };
|
|
112
|
+
if ((0, climate_automation_ledger_utils_1.canonical)(await (0, thermostat_controller_mutation_1.readControllerMutationImage)(manager, id)) !== (0, climate_automation_ledger_utils_1.canonical)(image))
|
|
113
|
+
fail();
|
|
114
|
+
return asJson({ revision: row.revision, image, history });
|
|
115
|
+
},
|
|
116
|
+
validateControllerRecreationInManager: (manager, id, preparation) => (0, virtual_thermostat_runtime_ownership_1.assertThermostatRecreationHistory)(manager, id, preparation.history),
|
|
117
|
+
withAutomationWrite: (work) => this.withAutomationWrite(work),
|
|
118
|
+
resolveActionInManager: (manager, id, action) => this.resolveAction(manager, id, action),
|
|
119
|
+
retireControllerInManager: (manager, slot) => this.retireController(manager, slot),
|
|
120
|
+
beginSourceMutation: (producerKey, subjectId, generationId) => this.beginSourceMutation(producerKey, subjectId, generationId),
|
|
121
|
+
graphRefreshVersion: 1,
|
|
122
|
+
ownedSettlementVersion: 1,
|
|
123
|
+
settleInstalled: (slots, producer, owned) => this.settleInstalled(slots, producer, owned),
|
|
124
|
+
readControllerInManager: (manager, id) => this.readController(manager, id),
|
|
125
|
+
validateSelectionInManager: async (manager, id, _facts, value) => {
|
|
126
|
+
const row = await manager.findOneBy(virtual_thermostat_entity_1.VirtualThermostatConfigEntity, { controllerId: id });
|
|
127
|
+
const owner = await manager.findOneBy(devices_virtual_entity_1.VirtualDeviceEntity, { id });
|
|
128
|
+
return owner?.enabled === true && !!row && this.selection(row, value) !== null;
|
|
129
|
+
},
|
|
130
|
+
installControllerInManager: (manager, slot) => this.installController(manager, slot),
|
|
131
|
+
refreshControllerInManager: (manager, slot, before, kind) => this.refreshController(manager, slot, before, kind),
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
onModuleInit() {
|
|
135
|
+
if (process.env.FB_CLI === 'on')
|
|
136
|
+
return;
|
|
137
|
+
if (this.destroyed || this.registration)
|
|
138
|
+
fail();
|
|
139
|
+
this.registration = this.registry.registerProviderOwned(exports.THERMOSTAT_AUTOMATION_PROVIDER, this.provider) ?? undefined;
|
|
140
|
+
if (!this.registration)
|
|
141
|
+
fail();
|
|
142
|
+
this.removeCompletion = this.graph.observeCompletion((revision, current) => this.renewCompletedGraph(revision, current));
|
|
143
|
+
}
|
|
144
|
+
async onApplicationBootstrap() {
|
|
145
|
+
if (process.env.FB_CLI === 'on')
|
|
146
|
+
return;
|
|
147
|
+
const provider = this.registry.captureProvider(exports.THERMOSTAT_AUTOMATION_PROVIDER);
|
|
148
|
+
if (!this.structure || this.destroyed || provider?.implementation !== this.provider)
|
|
149
|
+
fail();
|
|
150
|
+
await this.structure.runExclusive(async () => {
|
|
151
|
+
const owner = this.structure.captureExclusiveOwner();
|
|
152
|
+
let receipt;
|
|
153
|
+
const sql = await this.database.transaction(async (manager) => {
|
|
154
|
+
receipt = (0, sqlite_data_source_1.observeSqliteOuterOutcome)(manager);
|
|
155
|
+
(0, sqlite_data_source_1.registerSqliteCommitGuard)(manager, () => owner() && !this.destroyed && provider.isCurrent());
|
|
156
|
+
await manager.query('UPDATE "devices_virtual_graph_revision" SET "revision"="revision" WHERE 0');
|
|
157
|
+
const expected = await (0, virtual_thermostat_ownership_sql_1.climateDeletionCaptureSql)(manager);
|
|
158
|
+
const read = () => manager.query('SELECT "sql" FROM sqlite_master WHERE "name" = ?', [
|
|
159
|
+
'virtual_thermostat_capture_admitted_deletion',
|
|
160
|
+
]);
|
|
161
|
+
const before = await read();
|
|
162
|
+
if (!before.length && this.database.options.synchronize === true)
|
|
163
|
+
await manager.query(expected);
|
|
164
|
+
const after = await read();
|
|
165
|
+
if (after.length !== 1 || after[0].sql !== expected)
|
|
166
|
+
fail();
|
|
167
|
+
return expected;
|
|
168
|
+
});
|
|
169
|
+
if (receipt?.outcome !== 'committed' || !owner() || this.destroyed || !provider.isCurrent())
|
|
170
|
+
fail();
|
|
171
|
+
this.deletionSchema = sql;
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
async assertDeletionSchema(manager) {
|
|
175
|
+
if (this.destroyed || !this.deletionSchema)
|
|
176
|
+
fail();
|
|
177
|
+
const rows = await manager.query('SELECT "sql" FROM sqlite_master WHERE "name" = ?', [
|
|
178
|
+
'virtual_thermostat_capture_admitted_deletion',
|
|
179
|
+
]);
|
|
180
|
+
if (rows.length !== 1 || rows[0].sql !== this.deletionSchema)
|
|
181
|
+
fail();
|
|
182
|
+
}
|
|
183
|
+
async validateDeletedController(manager, id, retained) {
|
|
184
|
+
await this.assertDeletionSchema(manager);
|
|
185
|
+
if ((await manager.query('SELECT "id" FROM "devices_module_devices" WHERE "id" = ?', [id])).length)
|
|
186
|
+
fail();
|
|
187
|
+
if ((0, climate_automation_ledger_utils_1.canonical)(await (0, thermostat_controller_mutation_1.readControllerMutationImage)(manager, id)) !== (0, climate_automation_ledger_utils_1.canonical)(retained))
|
|
188
|
+
fail();
|
|
189
|
+
}
|
|
190
|
+
async captureCreationPredecessor(id) {
|
|
191
|
+
const provider = this.registry.captureProvider(exports.THERMOSTAT_AUTOMATION_PROVIDER);
|
|
192
|
+
const runtime = this.runtime;
|
|
193
|
+
const current = () => !this.destroyed &&
|
|
194
|
+
!!provider &&
|
|
195
|
+
provider.isCurrent() &&
|
|
196
|
+
provider.implementation === this.provider &&
|
|
197
|
+
this.runtime === runtime;
|
|
198
|
+
if (!current())
|
|
199
|
+
fail();
|
|
200
|
+
const slot = id ? await this.database.manager.findOneBy(climate_automation_entity_1.ClimateAutomationSlotEntity, { controllerId: id }) : null;
|
|
201
|
+
const proof = slot
|
|
202
|
+
? await this.database.manager.findOneBy(climate_automation_entity_1.ClimateAutomationDeletionEntity, {
|
|
203
|
+
controllerId: id,
|
|
204
|
+
controllerIncarnation: slot.controllerIncarnation,
|
|
205
|
+
consumedByIncarnation: (0, typeorm_1.IsNull)(),
|
|
206
|
+
})
|
|
207
|
+
: null;
|
|
208
|
+
const expectedSlot = slot && (0, climate_automation_ledger_utils_1.canonical)({ ...slot });
|
|
209
|
+
const expectedProof = proof && (0, climate_automation_ledger_utils_1.canonical)({ ...proof });
|
|
210
|
+
if (!current())
|
|
211
|
+
fail();
|
|
212
|
+
if (proof) {
|
|
213
|
+
this.revoke(id);
|
|
214
|
+
await (runtime?.capture(id) ?? Promise.resolve());
|
|
215
|
+
if (!current())
|
|
216
|
+
fail();
|
|
217
|
+
}
|
|
218
|
+
return async (manager) => {
|
|
219
|
+
if (!current())
|
|
220
|
+
fail();
|
|
221
|
+
(0, sqlite_data_source_1.registerSqliteCommitGuard)(manager, current);
|
|
222
|
+
if (proof) {
|
|
223
|
+
const actualSlot = await manager.findOneBy(climate_automation_entity_1.ClimateAutomationSlotEntity, { controllerId: id });
|
|
224
|
+
const actualProof = await manager.findOneBy(climate_automation_entity_1.ClimateAutomationDeletionEntity, { deletionId: proof.deletionId });
|
|
225
|
+
if (!actualSlot ||
|
|
226
|
+
!actualProof ||
|
|
227
|
+
(0, climate_automation_ledger_utils_1.canonical)({ ...actualSlot }) !== expectedSlot ||
|
|
228
|
+
(0, climate_automation_ledger_utils_1.canonical)({ ...actualProof }) !== expectedProof)
|
|
229
|
+
fail();
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
async captureCreation(manager, id, predecessor) {
|
|
234
|
+
if (predecessor)
|
|
235
|
+
await predecessor(manager);
|
|
236
|
+
const provider = this.registry.captureProvider(exports.THERMOSTAT_AUTOMATION_PROVIDER);
|
|
237
|
+
if (!provider || provider.implementation !== this.provider || this.destroyed)
|
|
238
|
+
fail();
|
|
239
|
+
const current = () => !this.destroyed && provider.isCurrent() && provider.implementation === this.provider;
|
|
240
|
+
(0, sqlite_data_source_1.registerSqliteCommitGuard)(manager, current);
|
|
241
|
+
const scope = this.ledger.currentScope(manager);
|
|
242
|
+
const recreate = await this.ledger.captureControllerRecreation(manager, scope, id);
|
|
243
|
+
if (!current())
|
|
244
|
+
fail();
|
|
245
|
+
const finish = async () => {
|
|
246
|
+
if (!current())
|
|
247
|
+
fail();
|
|
248
|
+
if (!recreate)
|
|
249
|
+
return this.initializeCreated(manager, id);
|
|
250
|
+
const slot = await this.ledger.readSlot(manager, scope, id, true, exports.THERMOSTAT_AUTOMATION_PROVIDER);
|
|
251
|
+
await recreate.consume(slot);
|
|
252
|
+
};
|
|
253
|
+
if (!recreate)
|
|
254
|
+
return Object.freeze({ finish });
|
|
255
|
+
const prepared = recreate.preparation;
|
|
256
|
+
return Object.freeze({
|
|
257
|
+
expectedRevision: prepared.revision,
|
|
258
|
+
finish,
|
|
259
|
+
beforePersist: async () => {
|
|
260
|
+
if (!current())
|
|
261
|
+
fail();
|
|
262
|
+
const image = await (0, thermostat_controller_mutation_1.readControllerMutationImage)(manager, id);
|
|
263
|
+
if ((0, climate_automation_ledger_utils_1.canonical)({ ...image, properties: [] }) !== (0, climate_automation_ledger_utils_1.canonical)(prepared.image))
|
|
264
|
+
fail();
|
|
265
|
+
await (0, virtual_thermostat_runtime_ownership_1.assertThermostatRecreationHistory)(manager, id, prepared.history);
|
|
266
|
+
return image;
|
|
267
|
+
},
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
onModuleDestroy() {
|
|
271
|
+
this.destroyed = true;
|
|
272
|
+
this.removeCompletion?.();
|
|
273
|
+
this.removeCompletion = undefined;
|
|
274
|
+
this.runtime = undefined;
|
|
275
|
+
this.publication = undefined;
|
|
276
|
+
this.localAdmissions.clear();
|
|
277
|
+
this.mutationVacancies.clear();
|
|
278
|
+
for (const cohort of this.mutationCohorts.values())
|
|
279
|
+
cohort.valid = false;
|
|
280
|
+
this.mutationCohorts.clear();
|
|
281
|
+
this.registration?.dispose();
|
|
282
|
+
this.registration = undefined;
|
|
283
|
+
}
|
|
284
|
+
revoke(id) {
|
|
285
|
+
this.mutationVacancies.delete(id);
|
|
286
|
+
this.localAdmissions.delete(id);
|
|
287
|
+
this.installations.delete(id);
|
|
288
|
+
}
|
|
289
|
+
removeOriginalInstallation(id, original) {
|
|
290
|
+
if (this.installations.get(id) !== original)
|
|
291
|
+
return;
|
|
292
|
+
const pending = this.localAdmissions.get(id);
|
|
293
|
+
if (original.attempt && pending?.attempt && pending.attempt !== original.attempt && pending.prior === original)
|
|
294
|
+
this.removedPredecessors.set(pending, original);
|
|
295
|
+
this.installations.delete(id);
|
|
296
|
+
}
|
|
297
|
+
registerRuntime(capture, request) {
|
|
298
|
+
if (this.destroyed || this.runtime)
|
|
299
|
+
fail();
|
|
300
|
+
const registration = Object.freeze({ capture, request });
|
|
301
|
+
this.runtime = registration;
|
|
302
|
+
return () => {
|
|
303
|
+
if (this.runtime === registration) {
|
|
304
|
+
this.runtime = undefined;
|
|
305
|
+
this.localAdmissions.clear();
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
async restoreCurrentInstallations() {
|
|
310
|
+
const runtime = this.runtime, provider = this.registry.captureProvider(exports.THERMOSTAT_AUTOMATION_PROVIDER);
|
|
311
|
+
if (!runtime ||
|
|
312
|
+
this.restoredRuntime === runtime ||
|
|
313
|
+
this.destroyed ||
|
|
314
|
+
provider?.implementation !== this.provider ||
|
|
315
|
+
!this.structure)
|
|
316
|
+
return;
|
|
317
|
+
this.restoredRuntime = runtime;
|
|
318
|
+
const rows = await this.database.manager.findBy(climate_automation_entity_1.ClimateAutomationSlotEntity, {
|
|
319
|
+
providerKey: exports.THERMOSTAT_AUTOMATION_PROVIDER,
|
|
320
|
+
state: 'LIVE',
|
|
321
|
+
});
|
|
322
|
+
const groups = new Map();
|
|
323
|
+
for (const row of rows)
|
|
324
|
+
groups.set(row.generationId, [...(groups.get(row.generationId) ?? []), { ...row }]);
|
|
325
|
+
for (const slots of groups.values()) {
|
|
326
|
+
await Promise.all(slots.map((slot) => this.beginMutation(slot.controllerId)));
|
|
327
|
+
const admitted = new Map();
|
|
328
|
+
let complete = false;
|
|
329
|
+
try {
|
|
330
|
+
complete = await this.structure.runShared(() => this.database.transaction(async (manager) => {
|
|
331
|
+
if (this.runtime !== runtime || !provider.isCurrent())
|
|
332
|
+
return false;
|
|
333
|
+
const source = await manager.findOneBy(climate_automation_entity_1.ClimateAutomationSourceEntity, {
|
|
334
|
+
generationId: slots[0].generationId,
|
|
335
|
+
});
|
|
336
|
+
const producer = source && this.registry.captureProducer(source.producerKey);
|
|
337
|
+
if (!source?.isCurrent || source.state !== 'FINALIZED_LIVE' || !producer)
|
|
338
|
+
return false;
|
|
339
|
+
for (const slot of slots.sort((a, b) => a.controllerId.localeCompare(b.controllerId))) {
|
|
340
|
+
if (!(await this.activateLocal(manager, slot, producer, true)))
|
|
341
|
+
return false;
|
|
342
|
+
const original = this.installations.get(slot.controllerId);
|
|
343
|
+
if (!original)
|
|
344
|
+
return false;
|
|
345
|
+
admitted.set(slot.controllerId, original);
|
|
346
|
+
}
|
|
347
|
+
return (this.runtime === runtime &&
|
|
348
|
+
provider.isCurrent() &&
|
|
349
|
+
producer.isCurrent() &&
|
|
350
|
+
[...admitted].every(([id, original]) => this.installations.get(id) === original && original.providerCurrent() && original.graphCurrent()));
|
|
351
|
+
}));
|
|
352
|
+
complete = complete && [...admitted].every(([id, original]) => this.installations.get(id) === original);
|
|
353
|
+
if (complete) {
|
|
354
|
+
const admission = {};
|
|
355
|
+
this.generationAdmissions.set(slots[0].generationId, admission);
|
|
356
|
+
for (const [id, original] of admitted)
|
|
357
|
+
this.installations.set(id, { ...original, settled: true, admission });
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
finally {
|
|
361
|
+
if (!complete)
|
|
362
|
+
for (const [id, original] of admitted)
|
|
363
|
+
if (this.installations.get(id) === original)
|
|
364
|
+
this.revoke(id);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
beginMutation(id) {
|
|
369
|
+
const runtime = this.installations.get(id)?.runtime ?? this.localAdmissions.get(id)?.runtime ?? this.runtime;
|
|
370
|
+
this.revoke(id);
|
|
371
|
+
return runtime?.capture(id) ?? Promise.resolve();
|
|
372
|
+
}
|
|
373
|
+
registerPublication(run) {
|
|
374
|
+
if (this.destroyed || this.publication)
|
|
375
|
+
fail();
|
|
376
|
+
const publication = Object.freeze({ run });
|
|
377
|
+
this.publication = publication;
|
|
378
|
+
return () => {
|
|
379
|
+
if (this.publication === publication)
|
|
380
|
+
this.publication = undefined;
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
async beginSourceMutation(producerKey, subjectId, generationId) {
|
|
384
|
+
let cohort = this.mutationCohorts.get(generationId);
|
|
385
|
+
if (cohort?.closing) {
|
|
386
|
+
cohort.valid = false;
|
|
387
|
+
cohort = undefined;
|
|
388
|
+
}
|
|
389
|
+
if (!cohort) {
|
|
390
|
+
const group = new Map();
|
|
391
|
+
for (const [id, original] of this.installations) {
|
|
392
|
+
const source = JSON.parse(original.source);
|
|
393
|
+
if (source.producerKey === producerKey &&
|
|
394
|
+
source.subjectId === subjectId &&
|
|
395
|
+
source.generationId === generationId)
|
|
396
|
+
group.set(id, original);
|
|
397
|
+
}
|
|
398
|
+
cohort = {
|
|
399
|
+
producerKey,
|
|
400
|
+
subjectId,
|
|
401
|
+
generationId,
|
|
402
|
+
group,
|
|
403
|
+
admission: this.generationAdmissions.get(generationId),
|
|
404
|
+
owners: new Set(),
|
|
405
|
+
token: {},
|
|
406
|
+
valid: true,
|
|
407
|
+
closing: false,
|
|
408
|
+
};
|
|
409
|
+
this.mutationCohorts.set(generationId, cohort);
|
|
410
|
+
}
|
|
411
|
+
if (cohort.producerKey !== producerKey || cohort.subjectId !== subjectId)
|
|
412
|
+
fail();
|
|
413
|
+
const originalCohort = cohort;
|
|
414
|
+
const token = {};
|
|
415
|
+
cohort.owners.add(token);
|
|
416
|
+
const ids = new Set([
|
|
417
|
+
...cohort.group.keys(),
|
|
418
|
+
...[...this.localAdmissions].filter(([, pending]) => pending.generationId === generationId).map(([id]) => id),
|
|
419
|
+
]);
|
|
420
|
+
const jobs = [...ids].map(async (id) => {
|
|
421
|
+
const original = originalCohort.group.get(id);
|
|
422
|
+
const runtime = original?.runtime ?? this.localAdmissions.get(id)?.runtime ?? this.runtime;
|
|
423
|
+
if (original) {
|
|
424
|
+
if (this.installations.get(id) === original) {
|
|
425
|
+
this.revoke(id);
|
|
426
|
+
this.mutationVacancies.set(id, { original, token: originalCohort.token });
|
|
427
|
+
}
|
|
428
|
+
else if (this.installations.has(id) ||
|
|
429
|
+
this.localAdmissions.has(id) ||
|
|
430
|
+
this.mutationVacancies.get(id)?.token !== originalCohort.token) {
|
|
431
|
+
originalCohort.valid = false;
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
else
|
|
436
|
+
this.revoke(id);
|
|
437
|
+
await runtime?.capture(id);
|
|
438
|
+
});
|
|
439
|
+
const results = await Promise.allSettled(jobs);
|
|
440
|
+
const failure = results.find((result) => result.status === 'rejected');
|
|
441
|
+
let consumed = false;
|
|
442
|
+
const completion = Object.freeze({
|
|
443
|
+
finish: async (outcome = 'unknown') => {
|
|
444
|
+
if (consumed)
|
|
445
|
+
return;
|
|
446
|
+
consumed = true;
|
|
447
|
+
if (outcome !== 'rolled_back' && outcome !== 'not_started')
|
|
448
|
+
originalCohort.valid = false;
|
|
449
|
+
originalCohort.owners.delete(token);
|
|
450
|
+
if (originalCohort.owners.size)
|
|
451
|
+
return;
|
|
452
|
+
originalCohort.closing = true;
|
|
453
|
+
const current = () => !this.destroyed &&
|
|
454
|
+
originalCohort.valid &&
|
|
455
|
+
this.mutationCohorts.get(generationId) === originalCohort &&
|
|
456
|
+
this.generationAdmissions.get(generationId) === originalCohort.admission &&
|
|
457
|
+
[...originalCohort.group].every(([id, original]) => this.mutationVacancies.get(id)?.token === originalCohort.token &&
|
|
458
|
+
this.mutationVacancies.get(id)?.original === original &&
|
|
459
|
+
original.custodyCurrent());
|
|
460
|
+
try {
|
|
461
|
+
if (!current())
|
|
462
|
+
return;
|
|
463
|
+
const graphCurrent = this.graph.capturePublishGuard();
|
|
464
|
+
const sourceGuards = new Map([...originalCohort.group].map(([id, original]) => [id, original.captureSourceCurrent()]));
|
|
465
|
+
const revision = await this.graph.revision();
|
|
466
|
+
if (current())
|
|
467
|
+
await this.renewGroup(originalCohort.group, revision, graphCurrent, { current, sourceGuards });
|
|
468
|
+
}
|
|
469
|
+
finally {
|
|
470
|
+
for (const id of originalCohort.group.keys())
|
|
471
|
+
if (this.mutationVacancies.get(id)?.token === originalCohort.token)
|
|
472
|
+
this.mutationVacancies.delete(id);
|
|
473
|
+
if (this.mutationCohorts.get(generationId) === originalCohort)
|
|
474
|
+
this.mutationCohorts.delete(generationId);
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
});
|
|
478
|
+
if (failure?.status === 'rejected') {
|
|
479
|
+
await completion.finish('unknown');
|
|
480
|
+
throw failure.reason;
|
|
481
|
+
}
|
|
482
|
+
return completion;
|
|
483
|
+
}
|
|
484
|
+
async withAutomationWrite(work) {
|
|
485
|
+
const provider = this.registry.captureProvider(exports.THERMOSTAT_AUTOMATION_PROVIDER);
|
|
486
|
+
if (!this.structure || this.destroyed || provider?.implementation !== this.provider)
|
|
487
|
+
fail();
|
|
488
|
+
return this.structure.runExclusive(async () => {
|
|
489
|
+
const owner = this.structure.captureExclusiveOwner();
|
|
490
|
+
let receipt;
|
|
491
|
+
return this.graph.withControllerMutationWrite(work, undefined, (manager) => {
|
|
492
|
+
receipt = (0, sqlite_data_source_1.observeSqliteOuterOutcome)(manager);
|
|
493
|
+
(0, sqlite_data_source_1.registerSqliteCommitGuard)(manager, () => owner() && provider.isCurrent());
|
|
494
|
+
}, () => {
|
|
495
|
+
if (receipt?.outcome !== 'committed')
|
|
496
|
+
fail();
|
|
497
|
+
});
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
async resolveAction(manager, id, action) {
|
|
501
|
+
if (!action || typeof action !== 'object' || Array.isArray(action))
|
|
502
|
+
return null;
|
|
503
|
+
const input = action;
|
|
504
|
+
const row = await manager.findOneBy(virtual_thermostat_entity_1.VirtualThermostatConfigEntity, { controllerId: id });
|
|
505
|
+
const owner = await manager.findOneBy(devices_virtual_entity_1.VirtualDeviceEntity, { id });
|
|
506
|
+
if (!owner?.enabled ||
|
|
507
|
+
owner.category !== devices_constants_1.DeviceCategory.THERMOSTAT ||
|
|
508
|
+
owner.mode !== devices_virtual_entity_1.VirtualDeviceMode.CLIMATE_CONTROLLER ||
|
|
509
|
+
!row?.comfort?.automation_enabled ||
|
|
510
|
+
row.locked)
|
|
511
|
+
return null;
|
|
512
|
+
if (input.thermostat_preset === undefined && input.mode !== 'heat' && input.mode !== 'cool')
|
|
513
|
+
return null;
|
|
514
|
+
let selection;
|
|
515
|
+
if (input.thermostat_preset !== undefined)
|
|
516
|
+
selection = { preset: input.thermostat_preset, setpoints: null };
|
|
517
|
+
else {
|
|
518
|
+
if ((input.setpoint === undefined) === (input.setpoint_delta === undefined))
|
|
519
|
+
return null;
|
|
520
|
+
const manual = row.comfort.presets.find((preset) => preset.preset === row.comfort.selected_preset)?.setpoints;
|
|
521
|
+
const values = {
|
|
522
|
+
heating_setpoint: manual ? manual.heating_setpoint : row.policy.heatingSetpoint,
|
|
523
|
+
cooling_setpoint: manual ? manual.cooling_setpoint : row.policy.coolingSetpoint,
|
|
524
|
+
};
|
|
525
|
+
for (const key of [input.mode === 'heat' ? 'heating_setpoint' : 'cooling_setpoint']) {
|
|
526
|
+
const range = key === 'heating_setpoint' ? row.comfort.heating_range : row.comfort.cooling_range;
|
|
527
|
+
if (!range)
|
|
528
|
+
return null;
|
|
529
|
+
if (input.setpoint !== undefined)
|
|
530
|
+
values[key] = input.setpoint;
|
|
531
|
+
else if (typeof values[key] === 'number')
|
|
532
|
+
values[key] += input.setpoint_delta;
|
|
533
|
+
else
|
|
534
|
+
return null;
|
|
535
|
+
}
|
|
536
|
+
selection = { preset: null, setpoints: values };
|
|
537
|
+
}
|
|
538
|
+
return this.selection(row, asJson(selection)) ? asJson(selection) : null;
|
|
539
|
+
}
|
|
540
|
+
async retireController(manager, slot, attempt) {
|
|
541
|
+
if (attempt) {
|
|
542
|
+
if (this.retiringGenerations.get(attempt.generation) !== attempt ||
|
|
543
|
+
this.generationAdmissions.get(attempt.generation) !== attempt)
|
|
544
|
+
fail();
|
|
545
|
+
}
|
|
546
|
+
else {
|
|
547
|
+
const vacancy = this.mutationVacancies.get(slot.controllerId);
|
|
548
|
+
if (!vacancy ||
|
|
549
|
+
vacancy.original.slot !== (0, climate_automation_ledger_utils_1.canonical)(slot) ||
|
|
550
|
+
this.installations.has(slot.controllerId) ||
|
|
551
|
+
this.localAdmissions.has(slot.controllerId))
|
|
552
|
+
this.revoke(slot.controllerId);
|
|
553
|
+
}
|
|
554
|
+
if (!['LIVE', 'PROVISIONAL'].includes(slot.state) || !slot.baselineId || !slot.selection)
|
|
555
|
+
fail();
|
|
556
|
+
const actual = await manager.findOneBy(climate_automation_entity_1.ClimateAutomationSlotEntity, { controllerId: slot.controllerId });
|
|
557
|
+
const source = await manager.findOneBy(climate_automation_entity_1.ClimateAutomationSourceEntity, { generationId: slot.generationId });
|
|
558
|
+
if (!actual ||
|
|
559
|
+
(0, climate_automation_ledger_utils_1.canonical)({ ...actual }) !== (0, climate_automation_ledger_utils_1.canonical)(slot) ||
|
|
560
|
+
!source ||
|
|
561
|
+
source.ownerId !== slot.ownerId ||
|
|
562
|
+
!source.isCurrent)
|
|
563
|
+
fail();
|
|
564
|
+
const row = await manager.findOneBy(virtual_thermostat_entity_1.VirtualThermostatConfigEntity, { controllerId: slot.controllerId });
|
|
565
|
+
if (!row?.comfort?.automation_baseline)
|
|
566
|
+
return;
|
|
567
|
+
const mirror = row.comfort.automation_baseline;
|
|
568
|
+
const selection = JSON.parse(slot.selection);
|
|
569
|
+
if (mirror.actor_id !== slot.baselineId ||
|
|
570
|
+
(0, climate_automation_ledger_utils_1.canonical)({ preset: mirror.preset, setpoints: mirror.setpoints }) !== (0, climate_automation_ledger_utils_1.canonical)(selection))
|
|
571
|
+
return;
|
|
572
|
+
const before = await (0, thermostat_controller_mutation_1.readControllerMutationImage)(manager, slot.controllerId);
|
|
573
|
+
if (!Number.isSafeInteger(row.revision) || row.revision >= Number.MAX_SAFE_INTEGER)
|
|
574
|
+
fail();
|
|
575
|
+
row.revision++;
|
|
576
|
+
row.comfort.automation_baseline = null;
|
|
577
|
+
const configuration = await (0, thermostat_controller_mutation_1.writeControllerPartition)(manager, 'configuration', before.configuration, [row]);
|
|
578
|
+
await (0, thermostat_controller_mutation_1.assertControllerMutationImage)(manager, slot.controllerId, { ...before, configuration });
|
|
579
|
+
}
|
|
580
|
+
ownSettlement(slots, owned) {
|
|
581
|
+
const originals = slots.map((slot) => Object.freeze({ ...slot }));
|
|
582
|
+
const generation = originals[0]?.generationId;
|
|
583
|
+
if (!generation || originals.some((slot) => slot.generationId !== generation))
|
|
584
|
+
fail();
|
|
585
|
+
const runtime = this.runtime, publication = this.publication;
|
|
586
|
+
const retire = this.retireController.bind(this);
|
|
587
|
+
const read = this.readController.bind(this);
|
|
588
|
+
let active = true, finished = false;
|
|
589
|
+
let permit;
|
|
590
|
+
const isSettled = owned.isSettled;
|
|
591
|
+
const attempt = Object.freeze({
|
|
592
|
+
generation,
|
|
593
|
+
current: () => active && owned.isCurrent(),
|
|
594
|
+
settled: () => isSettled?.call(owned) === true,
|
|
595
|
+
});
|
|
596
|
+
const eligible = !this.retiringGenerations.has(generation);
|
|
597
|
+
if (eligible)
|
|
598
|
+
this.generationAdmissions.set(generation, attempt);
|
|
599
|
+
const same = () => eligible &&
|
|
600
|
+
!this.destroyed &&
|
|
601
|
+
this.runtime === runtime &&
|
|
602
|
+
this.publication === publication &&
|
|
603
|
+
this.generationAdmissions.get(generation) === attempt &&
|
|
604
|
+
owned.isCurrent();
|
|
605
|
+
const invalidateOriginal = () => {
|
|
606
|
+
active = false;
|
|
607
|
+
for (const slot of originals) {
|
|
608
|
+
const original = this.installations.get(slot.controllerId);
|
|
609
|
+
if (original?.attempt === attempt)
|
|
610
|
+
this.removeOriginalInstallation(slot.controllerId, original);
|
|
611
|
+
if (this.localAdmissions.get(slot.controllerId)?.attempt === attempt)
|
|
612
|
+
this.localAdmissions.delete(slot.controllerId);
|
|
613
|
+
}
|
|
614
|
+
};
|
|
615
|
+
owned.accept(Object.freeze({
|
|
616
|
+
isCurrent: () => active && same(),
|
|
617
|
+
invalidateOriginal,
|
|
618
|
+
beginRetirement: () => {
|
|
619
|
+
invalidateOriginal();
|
|
620
|
+
if (permit)
|
|
621
|
+
return permit;
|
|
622
|
+
if (!same() || this.retiringGenerations.has(generation))
|
|
623
|
+
return null;
|
|
624
|
+
this.retiringGenerations.set(generation, attempt);
|
|
625
|
+
const jobs = originals.map((slot) => {
|
|
626
|
+
try {
|
|
627
|
+
return runtime?.capture(slot.controllerId) ?? Promise.resolve();
|
|
628
|
+
}
|
|
629
|
+
catch (cause) {
|
|
630
|
+
return Promise.reject(cause);
|
|
631
|
+
}
|
|
632
|
+
});
|
|
633
|
+
const predecessors = Promise.allSettled(jobs).then((results) => {
|
|
634
|
+
const failure = results.find((result) => result.status === 'rejected');
|
|
635
|
+
if (failure?.status === 'rejected')
|
|
636
|
+
throw failure.reason;
|
|
637
|
+
});
|
|
638
|
+
void predecessors.catch(() => undefined);
|
|
639
|
+
permit = Object.freeze({
|
|
640
|
+
predecessors,
|
|
641
|
+
isCurrent: () => !finished && same() && this.retiringGenerations.get(generation) === attempt,
|
|
642
|
+
finish: () => {
|
|
643
|
+
finished = true;
|
|
644
|
+
if (this.generationAdmissions.get(generation) === attempt)
|
|
645
|
+
this.generationAdmissions.delete(generation);
|
|
646
|
+
if (this.retiringGenerations.get(generation) === attempt)
|
|
647
|
+
this.retiringGenerations.delete(generation);
|
|
648
|
+
},
|
|
649
|
+
});
|
|
650
|
+
return permit;
|
|
651
|
+
},
|
|
652
|
+
retireInManager: async (manager) => {
|
|
653
|
+
if (!permit?.isCurrent())
|
|
654
|
+
fail();
|
|
655
|
+
for (const slot of originals) {
|
|
656
|
+
if ((0, climate_automation_ledger_utils_1.canonical)(await read(manager, slot.controllerId)) !== slot.installEvidence)
|
|
657
|
+
fail();
|
|
658
|
+
await retire(manager, slot, attempt);
|
|
659
|
+
}
|
|
660
|
+
},
|
|
661
|
+
}));
|
|
662
|
+
return attempt;
|
|
663
|
+
}
|
|
664
|
+
async settleInstalled(slots, producer, owned) {
|
|
665
|
+
const attempt = owned ? this.ownSettlement(slots, owned) : undefined;
|
|
666
|
+
const publication = this.publication, runtime = this.runtime;
|
|
667
|
+
if (!publication || this.destroyed)
|
|
668
|
+
return false;
|
|
669
|
+
await controller_publication_context_1.ControllerPublicationContext.complete(async () => {
|
|
670
|
+
for (const slot of slots)
|
|
671
|
+
await publication.run(slot.controllerId);
|
|
672
|
+
});
|
|
673
|
+
if (this.publication !== publication || this.runtime !== runtime || this.destroyed)
|
|
674
|
+
return false;
|
|
675
|
+
const admitted = new Map();
|
|
676
|
+
const retireOriginals = () => {
|
|
677
|
+
for (const [id, original] of admitted)
|
|
678
|
+
this.removeOriginalInstallation(id, original);
|
|
679
|
+
return false;
|
|
680
|
+
};
|
|
681
|
+
try {
|
|
682
|
+
for (const slot of slots) {
|
|
683
|
+
if (!(await this.activateLocal(this.database.manager, slot, producer, false, attempt)))
|
|
684
|
+
return retireOriginals();
|
|
685
|
+
const original = this.installations.get(slot.controllerId);
|
|
686
|
+
if (!original)
|
|
687
|
+
return retireOriginals();
|
|
688
|
+
admitted.set(slot.controllerId, original);
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
catch (cause) {
|
|
692
|
+
retireOriginals();
|
|
693
|
+
throw cause;
|
|
694
|
+
}
|
|
695
|
+
if (runtime?.request) {
|
|
696
|
+
const results = await Promise.allSettled([...admitted.keys()].map((id) => Promise.resolve().then(() => runtime.request(id))));
|
|
697
|
+
if (results.some((result) => result.status === 'rejected'))
|
|
698
|
+
return retireOriginals();
|
|
699
|
+
}
|
|
700
|
+
if (this.runtime !== runtime ||
|
|
701
|
+
this.publication !== publication ||
|
|
702
|
+
this.destroyed ||
|
|
703
|
+
[...admitted].some(([id, original]) => this.installations.get(id) !== original || !original.providerCurrent() || !original.graphCurrent()))
|
|
704
|
+
return retireOriginals();
|
|
705
|
+
for (const original of admitted.values())
|
|
706
|
+
original.settled = true;
|
|
707
|
+
return true;
|
|
708
|
+
}
|
|
709
|
+
selection(row, value) {
|
|
710
|
+
if (!value || typeof value !== 'object' || Array.isArray(value) || !row.comfort?.automation_enabled || row.locked)
|
|
711
|
+
return null;
|
|
712
|
+
const selection = value;
|
|
713
|
+
if ((selection.preset === null) === (selection.setpoints === null))
|
|
714
|
+
return null;
|
|
715
|
+
const setpoints = selection.preset
|
|
716
|
+
? row.comfort.presets.find((entry) => entry.preset === selection.preset)?.setpoints
|
|
717
|
+
: selection.setpoints;
|
|
718
|
+
if (!setpoints || (0, virtual_thermostat_comfort_utils_1.validateThermostatSetpoints)(setpoints, row.comfort, row.policy).length)
|
|
719
|
+
return null;
|
|
720
|
+
return { preset: selection.preset, setpoints: selection.setpoints };
|
|
721
|
+
}
|
|
722
|
+
async readController(manager, id) {
|
|
723
|
+
const owner = await manager.findOneBy(devices_virtual_entity_1.VirtualDeviceEntity, { id });
|
|
724
|
+
const row = await manager.findOneBy(virtual_thermostat_entity_1.VirtualThermostatConfigEntity, { controllerId: id });
|
|
725
|
+
if (!owner ||
|
|
726
|
+
owner.category !== devices_constants_1.DeviceCategory.THERMOSTAT ||
|
|
727
|
+
owner.mode !== devices_virtual_entity_1.VirtualDeviceMode.CLIMATE_CONTROLLER ||
|
|
728
|
+
row?.ownerDeviceId !== id)
|
|
729
|
+
return null;
|
|
730
|
+
return {
|
|
731
|
+
controllerRevision: row.revision,
|
|
732
|
+
graphRevision: await this.graph.revision(manager),
|
|
733
|
+
evidence: asJson({
|
|
734
|
+
owner: { id: owner.id, type: owner.type, enabled: owner.enabled, mode: owner.mode },
|
|
735
|
+
image: await (0, thermostat_controller_mutation_1.readControllerMutationImage)(manager, id),
|
|
736
|
+
}),
|
|
737
|
+
legacyBaseline: asJson(row.comfort?.automation_baseline ?? null),
|
|
738
|
+
};
|
|
739
|
+
}
|
|
740
|
+
async installController(manager, slot) {
|
|
741
|
+
const before = await (0, thermostat_controller_mutation_1.readControllerMutationImage)(manager, slot.controllerId);
|
|
742
|
+
const row = await manager.findOneByOrFail(virtual_thermostat_entity_1.VirtualThermostatConfigEntity, { controllerId: slot.controllerId });
|
|
743
|
+
const current = await this.readController(manager, slot.controllerId);
|
|
744
|
+
const owner = await manager.findOneBy(devices_virtual_entity_1.VirtualDeviceEntity, { id: slot.controllerId });
|
|
745
|
+
if (!owner?.enabled ||
|
|
746
|
+
!current ||
|
|
747
|
+
(0, climate_automation_ledger_utils_1.canonical)(current) !== slot.installEvidence ||
|
|
748
|
+
slot.manualHold ||
|
|
749
|
+
slot.state !== 'PROVISIONAL')
|
|
750
|
+
fail();
|
|
751
|
+
const selection = this.selection(row, JSON.parse(slot.selection));
|
|
752
|
+
if (!selection || (row.comfort.automation_baseline !== null && row.comfort.automation_baseline !== undefined))
|
|
753
|
+
fail();
|
|
754
|
+
if (!Number.isSafeInteger(row.revision) || row.revision >= Number.MAX_SAFE_INTEGER)
|
|
755
|
+
fail();
|
|
756
|
+
row.revision++;
|
|
757
|
+
row.comfort.automation_baseline = { ...selection, actor_id: slot.baselineId, revision: row.revision };
|
|
758
|
+
const configuration = await (0, thermostat_controller_mutation_1.writeControllerPartition)(manager, 'configuration', before.configuration, [row]);
|
|
759
|
+
await (0, thermostat_controller_mutation_1.assertControllerMutationImage)(manager, slot.controllerId, { ...before, configuration });
|
|
760
|
+
return this.readController(manager, slot.controllerId);
|
|
761
|
+
}
|
|
762
|
+
async withEvidenceWrite(work) {
|
|
763
|
+
const owner = this.structure.captureExclusiveOwner();
|
|
764
|
+
return this.database.transaction(async (manager) => {
|
|
765
|
+
const receipt = (0, sqlite_data_source_1.observeSqliteOuterOutcome)(manager);
|
|
766
|
+
const window = (0, sqlite_data_source_1.captureSqliteNoMutationWindow)(manager, owner);
|
|
767
|
+
await window.reserveZeroRows('devices_module_climate_automation_slots', 'slotRevision');
|
|
768
|
+
const result = await this.ledger.inAdmittedManager(manager, receipt, async () => {
|
|
769
|
+
const value = await work(manager);
|
|
770
|
+
window.beginFinalValidation();
|
|
771
|
+
return value;
|
|
772
|
+
});
|
|
773
|
+
window.applied();
|
|
774
|
+
return result;
|
|
775
|
+
});
|
|
776
|
+
}
|
|
777
|
+
async withRenewalWrite(work) {
|
|
778
|
+
const owner = this.structure.captureExclusiveOwner();
|
|
779
|
+
return this.database.transaction(async (manager) => {
|
|
780
|
+
const receipt = (0, sqlite_data_source_1.observeSqliteOuterOutcome)(manager);
|
|
781
|
+
const window = (0, sqlite_data_source_1.captureSqliteNoMutationWindow)(manager, owner);
|
|
782
|
+
await window.reserveZeroRows('devices_module_climate_automation_slots', 'slotRevision');
|
|
783
|
+
const checkpoint = window.beginReads();
|
|
784
|
+
const renewed = await this.ledger.inAdmittedManager(manager, receipt, async () => {
|
|
785
|
+
const result = await work(manager);
|
|
786
|
+
if (result === true)
|
|
787
|
+
window.beginFinalValidation();
|
|
788
|
+
else if (result !== false)
|
|
789
|
+
fail();
|
|
790
|
+
return result;
|
|
791
|
+
});
|
|
792
|
+
if (renewed)
|
|
793
|
+
window.applied();
|
|
794
|
+
else
|
|
795
|
+
window.armUnchanged(checkpoint);
|
|
796
|
+
return renewed;
|
|
797
|
+
});
|
|
798
|
+
}
|
|
799
|
+
async renewCompletedGraph(revision, current) {
|
|
800
|
+
const groups = new Map();
|
|
801
|
+
for (const [id, original] of this.installations) {
|
|
802
|
+
const slot = JSON.parse(original.slot);
|
|
803
|
+
const group = groups.get(slot.generationId) ?? new Map();
|
|
804
|
+
group.set(id, original);
|
|
805
|
+
groups.set(slot.generationId, group);
|
|
806
|
+
}
|
|
807
|
+
for (const group of groups.values())
|
|
808
|
+
await this.renewGroup(group, revision, current);
|
|
809
|
+
}
|
|
810
|
+
async renewGroup(group, revision, graphCurrent, recovery) {
|
|
811
|
+
const first = group.values().next().value;
|
|
812
|
+
if (!first || !this.structure)
|
|
813
|
+
return;
|
|
814
|
+
const generation = JSON.parse(first.slot).generationId;
|
|
815
|
+
const originalAdmission = this.generationAdmissions.get(generation);
|
|
816
|
+
const sourceGuard = (id, original) => recovery?.sourceGuards.get(id) ?? original.sourceCurrent;
|
|
817
|
+
const eligible = () => !this.destroyed &&
|
|
818
|
+
graphCurrent() &&
|
|
819
|
+
this.graph.isRevisionCurrent(revision) &&
|
|
820
|
+
this.generationAdmissions.get(generation) === originalAdmission &&
|
|
821
|
+
!this.retiringGenerations.has(generation) &&
|
|
822
|
+
(!recovery || recovery.current()) &&
|
|
823
|
+
[...group].every(([id, original]) => original.settled &&
|
|
824
|
+
original.admission === originalAdmission &&
|
|
825
|
+
(!original.attempt || original.attempt.settled()) &&
|
|
826
|
+
original.custodyCurrent() &&
|
|
827
|
+
sourceGuard(id, original)() &&
|
|
828
|
+
(recovery ? !this.installations.has(id) : this.installations.get(id) === original) &&
|
|
829
|
+
!this.localAdmissions.has(id));
|
|
830
|
+
if (!eligible())
|
|
831
|
+
return;
|
|
832
|
+
if ((0, sqlite_data_source_1.hasCurrentSqliteConnectionLease)(this.database))
|
|
833
|
+
fail();
|
|
834
|
+
const renew = async () => {
|
|
835
|
+
const owner = this.structure.captureExclusiveOwner();
|
|
836
|
+
const current = () => owner() && eligible();
|
|
837
|
+
if (!current())
|
|
838
|
+
return;
|
|
839
|
+
let receipt;
|
|
840
|
+
const next = new Map();
|
|
841
|
+
const renewed = await this.withRenewalWrite(async (manager) => {
|
|
842
|
+
receipt = (0, sqlite_data_source_1.observeSqliteOuterOutcome)(manager);
|
|
843
|
+
const scope = this.ledger.currentScope(manager);
|
|
844
|
+
const members = await manager.findBy(climate_automation_entity_1.ClimateAutomationSlotEntity, { generationId: generation, state: 'LIVE' });
|
|
845
|
+
if (!current() || members.length !== group.size || members.some((slot) => !group.has(slot.controllerId)))
|
|
846
|
+
return false;
|
|
847
|
+
(0, sqlite_data_source_1.registerSqliteCommitGuard)(manager, current);
|
|
848
|
+
this.graphRenewals.set(manager, {
|
|
849
|
+
revision,
|
|
850
|
+
current,
|
|
851
|
+
slots: new Map([...group].map(([id, original]) => [id, original.slot])),
|
|
852
|
+
});
|
|
853
|
+
try {
|
|
854
|
+
for (const [id, original] of group) {
|
|
855
|
+
if (!current())
|
|
856
|
+
fail();
|
|
857
|
+
const slot = await this.ledger.readSlot(manager, scope, id, true, exports.THERMOSTAT_AUTOMATION_PROVIDER);
|
|
858
|
+
const source = slot.facts && (await manager.findOneBy(climate_automation_entity_1.ClimateAutomationSourceEntity, { generationId: generation }));
|
|
859
|
+
if (!current() ||
|
|
860
|
+
!slot.facts ||
|
|
861
|
+
(0, climate_automation_ledger_utils_1.canonical)(slot.facts) !== original.slot ||
|
|
862
|
+
!source?.isCurrent ||
|
|
863
|
+
source.state !== 'FINALIZED_LIVE' ||
|
|
864
|
+
(0, climate_automation_ledger_utils_1.canonical)({ ...source }) !== original.source ||
|
|
865
|
+
slot.controller?.graphRevision !== revision)
|
|
866
|
+
fail();
|
|
867
|
+
const refreshed = await this.ledger.refreshInstalledSlot(manager, scope, slot, 'graph', !!recovery);
|
|
868
|
+
if (!current())
|
|
869
|
+
fail();
|
|
870
|
+
next.set(id, refreshed.facts);
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
finally {
|
|
874
|
+
this.graphRenewals.delete(manager);
|
|
875
|
+
}
|
|
876
|
+
return true;
|
|
877
|
+
});
|
|
878
|
+
if (!renewed)
|
|
879
|
+
return;
|
|
880
|
+
if (receipt?.outcome !== 'committed' || next.size !== group.size)
|
|
881
|
+
fail();
|
|
882
|
+
if (!owner() || !graphCurrent() || !this.graph.isRevisionCurrent(revision))
|
|
883
|
+
fail();
|
|
884
|
+
if (!eligible())
|
|
885
|
+
return;
|
|
886
|
+
const admission = {};
|
|
887
|
+
this.generationAdmissions.set(generation, admission);
|
|
888
|
+
for (const [id, original] of group) {
|
|
889
|
+
const sourceCurrent = sourceGuard(id, original);
|
|
890
|
+
this.installations.set(id, {
|
|
891
|
+
...original,
|
|
892
|
+
admission,
|
|
893
|
+
attempt: undefined,
|
|
894
|
+
slot: (0, climate_automation_ledger_utils_1.canonical)(next.get(id)),
|
|
895
|
+
graphCurrent,
|
|
896
|
+
sourceCurrent,
|
|
897
|
+
providerCurrent: () => original.custodyCurrent() && sourceCurrent() && this.generationAdmissions.get(generation) === admission,
|
|
898
|
+
});
|
|
899
|
+
}
|
|
900
|
+
};
|
|
901
|
+
if (this.structure.hasCurrentStructuralLease())
|
|
902
|
+
await renew();
|
|
903
|
+
else
|
|
904
|
+
await this.structure.runExclusive(renew);
|
|
905
|
+
}
|
|
906
|
+
async captureInstalledIntent(manager, id) {
|
|
907
|
+
const scope = this.ledger.currentScope(manager);
|
|
908
|
+
const slot = await this.ledger.readSlot(manager, scope, id, false);
|
|
909
|
+
return slot.facts?.state === 'LIVE' && !slot.facts.manualHold
|
|
910
|
+
? this.ledger.readSlot(manager, scope, id, true, exports.THERMOSTAT_AUTOMATION_PROVIDER)
|
|
911
|
+
: null;
|
|
912
|
+
}
|
|
913
|
+
async captureManualBaseline(manager, id, graphDelta = 1) {
|
|
914
|
+
const owned = await this.captureInstalledIntent(manager, id);
|
|
915
|
+
if (!owned)
|
|
916
|
+
return null;
|
|
917
|
+
const slot = owned.facts, controller = owned.controller;
|
|
918
|
+
if (!slot?.installEvidence || !controller)
|
|
919
|
+
fail();
|
|
920
|
+
const installed = JSON.parse(slot.installEvidence);
|
|
921
|
+
if (controller.graphRevision !== installed.graphRevision + graphDelta ||
|
|
922
|
+
(0, climate_automation_ledger_utils_1.canonical)({ ...controller, graphRevision: installed.graphRevision }) !== slot.installEvidence)
|
|
923
|
+
fail();
|
|
924
|
+
return owned;
|
|
925
|
+
}
|
|
926
|
+
captureManualSlot(manager, id) {
|
|
927
|
+
return this.ledger.readSlot(manager, this.ledger.currentScope(manager), id, false);
|
|
928
|
+
}
|
|
929
|
+
async captureAppliedAuthority(manager, id, expected) {
|
|
930
|
+
const scope = this.ledger.currentScope(manager);
|
|
931
|
+
await this.ledger.readSlot(manager, scope, id, true, exports.THERMOSTAT_AUTOMATION_PROVIDER);
|
|
932
|
+
await (0, thermostat_controller_mutation_1.assertControllerMutationImage)(manager, id, expected);
|
|
933
|
+
}
|
|
934
|
+
async captureUnchangedAuthority(manager, id) {
|
|
935
|
+
const scope = this.ledger.currentScope(manager);
|
|
936
|
+
const slot = await this.ledger.readSlot(manager, scope, id, true, exports.THERMOSTAT_AUTOMATION_PROVIDER);
|
|
937
|
+
if (slot.facts &&
|
|
938
|
+
(![slot.facts.slotRevision, slot.facts.manualCounter].every((value) => Number.isSafeInteger(value) && value >= 1) ||
|
|
939
|
+
![slot.facts.controllerIncarnation, slot.facts.manualGeneration].every((value) => (0, class_validator_1.isUUID)(value))))
|
|
940
|
+
fail();
|
|
941
|
+
if (slot.facts?.generationId) {
|
|
942
|
+
const source = await manager.findOneByOrFail(climate_automation_entity_1.ClimateAutomationSourceEntity, {
|
|
943
|
+
generationId: slot.facts.generationId,
|
|
944
|
+
});
|
|
945
|
+
await this.ledger.readSource(manager, scope, source.producerKey, source.subjectId);
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
async refreshIntent(manager, before, kind = 'intent', qualifyResult) {
|
|
949
|
+
if (!before)
|
|
950
|
+
return null;
|
|
951
|
+
const scope = this.ledger.currentScope(manager);
|
|
952
|
+
const refreshed = await this.ledger.refreshInstalledSlot(manager, scope, before, kind);
|
|
953
|
+
let open = true;
|
|
954
|
+
try {
|
|
955
|
+
qualifyResult?.(this.selectionView(refreshed.facts, refreshed.controller.controllerRevision, () => open && this.ledger.currentScope(manager) === scope));
|
|
956
|
+
}
|
|
957
|
+
finally {
|
|
958
|
+
open = false;
|
|
959
|
+
}
|
|
960
|
+
return refreshed.facts;
|
|
961
|
+
}
|
|
962
|
+
selectionView(slot, revision, isCurrent) {
|
|
963
|
+
if (slot.state !== 'LIVE' || slot.manualHold || !slot.baselineId || !slot.selection)
|
|
964
|
+
fail();
|
|
965
|
+
const selection = JSON.parse(slot.selection);
|
|
966
|
+
return {
|
|
967
|
+
baseline: { ...selection, actor_id: slot.baselineId, revision },
|
|
968
|
+
manualHold: false,
|
|
969
|
+
isCurrent,
|
|
970
|
+
};
|
|
971
|
+
}
|
|
972
|
+
async refreshController(manager, slot, before, kind) {
|
|
973
|
+
const installed = JSON.parse(slot.installEvidence);
|
|
974
|
+
if (kind === 'graph') {
|
|
975
|
+
const original = this.graphRenewals.get(manager);
|
|
976
|
+
if (!original?.current() ||
|
|
977
|
+
original.slots.get(slot.controllerId) !== (0, climate_automation_ledger_utils_1.canonical)(slot) ||
|
|
978
|
+
before.graphRevision !== original.revision)
|
|
979
|
+
fail();
|
|
980
|
+
const after = await this.readController(manager, slot.controllerId);
|
|
981
|
+
if (!after ||
|
|
982
|
+
!Number.isSafeInteger(after.graphRevision) ||
|
|
983
|
+
after.graphRevision < installed.graphRevision ||
|
|
984
|
+
!original.current() ||
|
|
985
|
+
(0, climate_automation_ledger_utils_1.canonical)(after) !== (0, climate_automation_ledger_utils_1.canonical)(before) ||
|
|
986
|
+
(0, climate_automation_ledger_utils_1.canonical)({ ...after, graphRevision: installed.graphRevision }) !== slot.installEvidence)
|
|
987
|
+
fail();
|
|
988
|
+
return after;
|
|
989
|
+
}
|
|
990
|
+
if (kind !== 'intent' && kind !== 'watermark')
|
|
991
|
+
fail();
|
|
992
|
+
if ((before.graphRevision !== installed.graphRevision &&
|
|
993
|
+
!(kind === 'intent' && before.graphRevision === installed.graphRevision + 1)) ||
|
|
994
|
+
(0, climate_automation_ledger_utils_1.canonical)({ ...before, graphRevision: installed.graphRevision }) !== (0, climate_automation_ledger_utils_1.canonical)(installed))
|
|
995
|
+
fail();
|
|
996
|
+
const after = await this.readController(manager, slot.controllerId);
|
|
997
|
+
const row = await manager.findOneByOrFail(virtual_thermostat_entity_1.VirtualThermostatConfigEntity, { controllerId: slot.controllerId });
|
|
998
|
+
if (!after ||
|
|
999
|
+
after.controllerRevision !== before.controllerRevision + (kind === 'intent' ? 1 : 0) ||
|
|
1000
|
+
after.graphRevision !== installed.graphRevision + (kind === 'intent' ? 1 : 0) ||
|
|
1001
|
+
(0, climate_automation_ledger_utils_1.canonical)(after.legacyBaseline) !== (0, climate_automation_ledger_utils_1.canonical)(before.legacyBaseline) ||
|
|
1002
|
+
!this.selection(row, JSON.parse(slot.selection)))
|
|
1003
|
+
fail();
|
|
1004
|
+
const beforeEvidence = before.evidence;
|
|
1005
|
+
const afterEvidence = after.evidence;
|
|
1006
|
+
const oldConfig = beforeEvidence.image.configuration[0];
|
|
1007
|
+
const newConfig = afterEvidence.image.configuration[0];
|
|
1008
|
+
if (kind === 'watermark') {
|
|
1009
|
+
const oldComfort = JSON.parse(oldConfig.comfort);
|
|
1010
|
+
const newComfort = JSON.parse(newConfig.comfort);
|
|
1011
|
+
const oldOverride = oldComfort.temporary_override;
|
|
1012
|
+
const newOverride = newComfort.temporary_override;
|
|
1013
|
+
if (!oldOverride ||
|
|
1014
|
+
!newOverride ||
|
|
1015
|
+
newOverride.id !== oldOverride.id ||
|
|
1016
|
+
!Number.isFinite(newOverride.wall_watermark_ms) ||
|
|
1017
|
+
newOverride.wall_watermark_ms < oldOverride.wall_watermark_ms ||
|
|
1018
|
+
(0, climate_automation_ledger_utils_1.canonical)({
|
|
1019
|
+
...newComfort,
|
|
1020
|
+
temporary_override: { ...newOverride, wall_watermark_ms: oldOverride.wall_watermark_ms },
|
|
1021
|
+
}) !== (0, climate_automation_ledger_utils_1.canonical)(oldComfort))
|
|
1022
|
+
fail();
|
|
1023
|
+
}
|
|
1024
|
+
if ((0, climate_automation_ledger_utils_1.canonical)({
|
|
1025
|
+
...afterEvidence,
|
|
1026
|
+
image: {
|
|
1027
|
+
...afterEvidence.image,
|
|
1028
|
+
configuration: [{ ...newConfig, comfort: oldConfig.comfort, revision: oldConfig.revision }],
|
|
1029
|
+
},
|
|
1030
|
+
}) !== (0, climate_automation_ledger_utils_1.canonical)(beforeEvidence))
|
|
1031
|
+
fail();
|
|
1032
|
+
return after;
|
|
1033
|
+
}
|
|
1034
|
+
async manualFence(manager, id, hold, expected, takeover = true) {
|
|
1035
|
+
this.revoke(id);
|
|
1036
|
+
const scope = this.ledger.currentScope(manager);
|
|
1037
|
+
const slot = expected ?? (await this.ledger.readSlot(manager, scope, id, false));
|
|
1038
|
+
if (slot.facts && slot.facts.controllerId !== id)
|
|
1039
|
+
fail();
|
|
1040
|
+
if (slot.facts)
|
|
1041
|
+
await this.ledger.fenceManual(manager, scope, slot, hold ?? slot.facts.manualHold, takeover);
|
|
1042
|
+
}
|
|
1043
|
+
async initializeCreated(manager, id) {
|
|
1044
|
+
const scope = this.ledger.currentScope(manager);
|
|
1045
|
+
const expected = await this.ledger.readSlot(manager, scope, id, true, exports.THERMOSTAT_AUTOMATION_PROVIDER);
|
|
1046
|
+
if (expected.facts)
|
|
1047
|
+
fail();
|
|
1048
|
+
await this.ledger.initializeSlot(manager, scope, { expected, releaseManualHold: true });
|
|
1049
|
+
}
|
|
1050
|
+
async explicitOptIn(manager, id) {
|
|
1051
|
+
this.revoke(id);
|
|
1052
|
+
const scope = this.ledger.currentScope(manager);
|
|
1053
|
+
const row = await manager.findOneByOrFail(virtual_thermostat_entity_1.VirtualThermostatConfigEntity, { controllerId: id });
|
|
1054
|
+
if (!row.comfort?.automation_enabled || row.comfort.automation_baseline != null)
|
|
1055
|
+
return;
|
|
1056
|
+
const slot = await this.ledger.readSlot(manager, scope, id, true, exports.THERMOSTAT_AUTOMATION_PROVIDER);
|
|
1057
|
+
await this.ledger.initializeSlot(manager, scope, { expected: slot, releaseManualHold: true, explicitOptIn: true });
|
|
1058
|
+
}
|
|
1059
|
+
async activateLocal(manager, expected, expectedProducer, restoring = false, attempt) {
|
|
1060
|
+
const runtime = this.runtime;
|
|
1061
|
+
if (this.retiringGenerations.has(expected.generationId) ||
|
|
1062
|
+
(attempt && (!attempt.current() || this.generationAdmissions.get(expected.generationId) !== attempt)))
|
|
1063
|
+
return false;
|
|
1064
|
+
const prior = this.installations.get(expected.controllerId);
|
|
1065
|
+
const admission = Object.freeze({ generationId: expected.generationId, runtime, attempt, prior });
|
|
1066
|
+
if (!attempt)
|
|
1067
|
+
this.generationAdmissions.set(expected.generationId, admission);
|
|
1068
|
+
this.localAdmissions.set(expected.controllerId, admission);
|
|
1069
|
+
try {
|
|
1070
|
+
const provider = this.registry.captureProvider(exports.THERMOSTAT_AUTOMATION_PROVIDER);
|
|
1071
|
+
if (this.destroyed || !provider || provider.implementation !== this.provider)
|
|
1072
|
+
return false;
|
|
1073
|
+
const slot = await manager.findOneBy(climate_automation_entity_1.ClimateAutomationSlotEntity, { controllerId: expected.controllerId });
|
|
1074
|
+
const source = slot?.generationId
|
|
1075
|
+
? await manager.findOneBy(climate_automation_entity_1.ClimateAutomationSourceEntity, { generationId: slot.generationId })
|
|
1076
|
+
: null;
|
|
1077
|
+
if (!slot ||
|
|
1078
|
+
(0, climate_automation_ledger_utils_1.canonical)({ ...slot }) !== (0, climate_automation_ledger_utils_1.canonical)(expected) ||
|
|
1079
|
+
slot.state !== 'LIVE' ||
|
|
1080
|
+
slot.manualHold ||
|
|
1081
|
+
!source?.isCurrent ||
|
|
1082
|
+
source.state !== 'FINALIZED_LIVE')
|
|
1083
|
+
return false;
|
|
1084
|
+
const producer = this.registry.captureProducer(source.producerKey);
|
|
1085
|
+
if (!producer ||
|
|
1086
|
+
(expectedProducer &&
|
|
1087
|
+
(!expectedProducer.isCurrent() || producer.implementation !== expectedProducer.implementation)))
|
|
1088
|
+
return false;
|
|
1089
|
+
const methods = (0, creation_capture_1.captureCreation)(producer.implementation, ['validateInManager', 'captureCurrent']);
|
|
1090
|
+
const sourceCurrent = (methods.values.captureCurrent == null
|
|
1091
|
+
? undefined
|
|
1092
|
+
: (0, creation_capture_1.invokeCreation)(methods.values.captureCurrent, producer.implementation, source)) ?? (() => true);
|
|
1093
|
+
if ((0, climate_automation_ledger_utils_1.canonical)(await (0, creation_capture_1.invokeCreation)(methods.values.validateInManager, producer.implementation, manager, source, restoring ? 'restore' : 'prepare', provider)) !== source.evidence)
|
|
1094
|
+
return false;
|
|
1095
|
+
const controller = await this.readController(manager, slot.controllerId);
|
|
1096
|
+
if (this.runtime !== runtime ||
|
|
1097
|
+
this.retiringGenerations.has(expected.generationId) ||
|
|
1098
|
+
(attempt && (!attempt.current() || this.generationAdmissions.get(expected.generationId) !== attempt)) ||
|
|
1099
|
+
this.localAdmissions.get(expected.controllerId) !== admission ||
|
|
1100
|
+
(this.installations.get(expected.controllerId) !== prior &&
|
|
1101
|
+
!(prior &&
|
|
1102
|
+
this.installations.get(expected.controllerId) === undefined &&
|
|
1103
|
+
this.removedPredecessors.get(admission) === prior)) ||
|
|
1104
|
+
!controller ||
|
|
1105
|
+
(0, climate_automation_ledger_utils_1.canonical)(controller) !== slot.installEvidence ||
|
|
1106
|
+
!provider.isCurrent() ||
|
|
1107
|
+
!producer.isCurrent() ||
|
|
1108
|
+
!sourceCurrent() ||
|
|
1109
|
+
!methods.current() ||
|
|
1110
|
+
(expectedProducer && !expectedProducer.isCurrent()) ||
|
|
1111
|
+
!this.graph.isRevisionCurrent(controller.graphRevision))
|
|
1112
|
+
return false;
|
|
1113
|
+
const custodyCurrent = () => !this.destroyed &&
|
|
1114
|
+
this.runtime === runtime &&
|
|
1115
|
+
provider.isCurrent() &&
|
|
1116
|
+
producer.isCurrent() &&
|
|
1117
|
+
methods.current() &&
|
|
1118
|
+
(!expectedProducer || expectedProducer.isCurrent());
|
|
1119
|
+
this.installations.set(slot.controllerId, {
|
|
1120
|
+
settled: !attempt && !restoring,
|
|
1121
|
+
admission: attempt ?? admission,
|
|
1122
|
+
custodyCurrent,
|
|
1123
|
+
sourceCurrent,
|
|
1124
|
+
captureSourceCurrent: () => (methods.values.captureCurrent == null
|
|
1125
|
+
? undefined
|
|
1126
|
+
: (0, creation_capture_1.invokeCreation)(methods.values.captureCurrent, producer.implementation, source)) ?? (() => true),
|
|
1127
|
+
attempt,
|
|
1128
|
+
runtime,
|
|
1129
|
+
slot: (0, climate_automation_ledger_utils_1.canonical)({ ...slot }),
|
|
1130
|
+
source: (0, climate_automation_ledger_utils_1.canonical)({ ...source }),
|
|
1131
|
+
graphCurrent: this.graph.capturePublishGuard(),
|
|
1132
|
+
providerCurrent: () => (!attempt || (attempt.current() && this.generationAdmissions.get(attempt.generation) === attempt)) &&
|
|
1133
|
+
this.runtime === runtime &&
|
|
1134
|
+
provider.isCurrent() &&
|
|
1135
|
+
producer.isCurrent() &&
|
|
1136
|
+
sourceCurrent() &&
|
|
1137
|
+
methods.current() &&
|
|
1138
|
+
(!expectedProducer || expectedProducer.isCurrent()),
|
|
1139
|
+
});
|
|
1140
|
+
return true;
|
|
1141
|
+
}
|
|
1142
|
+
finally {
|
|
1143
|
+
if (this.localAdmissions.get(expected.controllerId) === admission)
|
|
1144
|
+
this.localAdmissions.delete(expected.controllerId);
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
async resolve(manager, row) {
|
|
1148
|
+
const slot = await manager.findOneBy(climate_automation_entity_1.ClimateAutomationSlotEntity, { controllerId: row.controllerId });
|
|
1149
|
+
const installation = this.installations.get(row.controllerId);
|
|
1150
|
+
const absent = (manualHold = slot?.manualHold ?? false) => ({
|
|
1151
|
+
baseline: null,
|
|
1152
|
+
manualHold,
|
|
1153
|
+
isCurrent: () => false,
|
|
1154
|
+
});
|
|
1155
|
+
if (!slot ||
|
|
1156
|
+
!installation ||
|
|
1157
|
+
slot.state !== 'LIVE' ||
|
|
1158
|
+
slot.manualHold ||
|
|
1159
|
+
(0, climate_automation_ledger_utils_1.canonical)({ ...slot }) !== installation.slot)
|
|
1160
|
+
return absent();
|
|
1161
|
+
const source = await manager.findOneBy(climate_automation_entity_1.ClimateAutomationSourceEntity, { generationId: slot.generationId });
|
|
1162
|
+
const controller = await this.readController(manager, row.controllerId);
|
|
1163
|
+
if (!source?.isCurrent ||
|
|
1164
|
+
source.state !== 'FINALIZED_LIVE' ||
|
|
1165
|
+
(0, climate_automation_ledger_utils_1.canonical)({ ...source }) !== installation.source ||
|
|
1166
|
+
!controller ||
|
|
1167
|
+
(0, climate_automation_ledger_utils_1.canonical)(controller) !== slot.installEvidence ||
|
|
1168
|
+
controller.controllerRevision !== row.revision)
|
|
1169
|
+
return absent();
|
|
1170
|
+
const isCurrent = () => !this.destroyed &&
|
|
1171
|
+
this.installations.get(row.controllerId) === installation &&
|
|
1172
|
+
installation.graphCurrent() &&
|
|
1173
|
+
installation.providerCurrent();
|
|
1174
|
+
if (!isCurrent())
|
|
1175
|
+
return absent();
|
|
1176
|
+
return this.selectionView(slot, row.revision, isCurrent);
|
|
1177
|
+
}
|
|
1178
|
+
};
|
|
1179
|
+
exports.VirtualThermostatAutomationService = VirtualThermostatAutomationService;
|
|
1180
|
+
exports.VirtualThermostatAutomationService = VirtualThermostatAutomationService = __decorate([
|
|
1181
|
+
(0, common_1.Injectable)(),
|
|
1182
|
+
__param(4, (0, common_1.Optional)()),
|
|
1183
|
+
__metadata("design:paramtypes", [typeorm_1.DataSource,
|
|
1184
|
+
climate_automation_registry_service_1.ClimateAutomationRegistryService,
|
|
1185
|
+
climate_automation_ledger_service_1.ClimateAutomationLedgerService,
|
|
1186
|
+
virtual_dependency_graph_service_1.VirtualDependencyGraphService,
|
|
1187
|
+
device_structure_lock_service_1.DeviceStructureLockService])
|
|
1188
|
+
], VirtualThermostatAutomationService);
|
|
1189
|
+
//# sourceMappingURL=virtual-thermostat-automation.service.js.map
|