@seamapi/react 2.20.0 → 3.0.1
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/README.md +4 -4
- package/dist/elements.js +19676 -25734
- package/dist/elements.js.map +1 -1
- package/lib/object.d.ts +5 -0
- package/lib/object.js +14 -0
- package/lib/object.js.map +1 -0
- package/lib/seam/SeamProvider.d.ts +5 -4
- package/lib/seam/SeamProvider.js.map +1 -1
- package/lib/seam/access-codes/use-access-code.d.ts +3 -2
- package/lib/seam/access-codes/use-access-code.js +2 -3
- package/lib/seam/access-codes/use-access-code.js.map +1 -1
- package/lib/seam/access-codes/use-access-codes.d.ts +3 -2
- package/lib/seam/access-codes/use-access-codes.js +3 -5
- package/lib/seam/access-codes/use-access-codes.js.map +1 -1
- package/lib/seam/access-codes/use-create-access-code.d.ts +4 -3
- package/lib/seam/access-codes/use-create-access-code.js +5 -4
- package/lib/seam/access-codes/use-create-access-code.js.map +1 -1
- package/lib/seam/access-codes/use-delete-access-code.d.ts +4 -6
- package/lib/seam/access-codes/use-delete-access-code.js +10 -8
- package/lib/seam/access-codes/use-delete-access-code.js.map +1 -1
- package/lib/seam/access-codes/use-generate-access-code-code.d.ts +4 -4
- package/lib/seam/access-codes/use-generate-access-code-code.js +3 -2
- package/lib/seam/access-codes/use-generate-access-code-code.js.map +1 -1
- package/lib/seam/access-codes/use-update-access-code.d.ts +4 -4
- package/lib/seam/access-codes/use-update-access-code.js +9 -7
- package/lib/seam/access-codes/use-update-access-code.js.map +1 -1
- package/lib/seam/client-sessions/use-client-session.d.ts +1 -1
- package/lib/seam/client-sessions/use-client-session.js +1 -1
- package/lib/seam/client-sessions/use-client-session.js.map +1 -1
- package/lib/seam/components/AccessCodeDetails/AccessCodeDetails.d.ts +1 -1
- package/lib/seam/components/AccessCodeDetails/AccessCodeDetails.js +14 -6
- package/lib/seam/components/AccessCodeDetails/AccessCodeDetails.js.map +1 -1
- package/lib/seam/components/AccessCodeDetails/AccessCodeDevice.d.ts +1 -1
- package/lib/seam/components/AccessCodeDetails/AccessCodeDevice.js +9 -6
- package/lib/seam/components/AccessCodeDetails/AccessCodeDevice.js.map +1 -1
- package/lib/seam/components/AccessCodeTable/AccessCodeHealthBar.d.ts +3 -4
- package/lib/seam/components/AccessCodeTable/AccessCodeHealthBar.js.map +1 -1
- package/lib/seam/components/AccessCodeTable/AccessCodeMainIcon.d.ts +3 -3
- package/lib/seam/components/AccessCodeTable/AccessCodeMainIcon.js.map +1 -1
- package/lib/seam/components/AccessCodeTable/AccessCodeMenu.d.ts +3 -3
- package/lib/seam/components/AccessCodeTable/AccessCodeMenu.js +1 -1
- package/lib/seam/components/AccessCodeTable/AccessCodeMenu.js.map +1 -1
- package/lib/seam/components/AccessCodeTable/AccessCodeRow.d.ts +3 -3
- package/lib/seam/components/AccessCodeTable/AccessCodeRow.js.map +1 -1
- package/lib/seam/components/AccessCodeTable/AccessCodeTable.d.ts +2 -4
- package/lib/seam/components/AccessCodeTable/AccessCodeTable.js +1 -1
- package/lib/seam/components/AccessCodeTable/AccessCodeTable.js.map +1 -1
- package/lib/seam/components/AccessCodeTable/CodeDetails.d.ts +2 -2
- package/lib/seam/components/AccessCodeTable/CodeDetails.js +5 -2
- package/lib/seam/components/AccessCodeTable/CodeDetails.js.map +1 -1
- package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleCard.d.ts +1 -1
- package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleCard.js +3 -1
- package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleCard.js.map +1 -1
- package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.d.ts +1 -1
- package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.js +3 -1
- package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.js.map +1 -1
- package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDeviceBar.d.ts +1 -1
- package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDeviceBar.js +3 -3
- package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDeviceBar.js.map +1 -1
- package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRow.d.ts +3 -3
- package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRow.js.map +1 -1
- package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRowDetails.d.ts +2 -2
- package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRowDetails.js.map +1 -1
- package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleTable.d.ts +2 -2
- package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleTable.js +1 -1
- package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleTable.js.map +1 -1
- package/lib/seam/components/ConnectAccountButton/ConnectAccountButton.d.ts +1 -1
- package/lib/seam/components/ConnectAccountButton/ConnectAccountButton.js +2 -2
- package/lib/seam/components/CreateAccessCodeForm/CreateAccessCodeForm.d.ts +3 -3
- package/lib/seam/components/CreateAccessCodeForm/CreateAccessCodeForm.js +12 -9
- package/lib/seam/components/CreateAccessCodeForm/CreateAccessCodeForm.js.map +1 -1
- package/lib/seam/components/CreateClimateSettingScheduleForm/CreateClimateSettingScheduleForm.d.ts +1 -1
- package/lib/seam/components/CreateClimateSettingScheduleForm/CreateClimateSettingScheduleForm.js +1 -1
- package/lib/seam/components/DeviceDetails/DeviceDetails.d.ts +1 -1
- package/lib/seam/components/DeviceDetails/DeviceDetails.js +3 -1
- package/lib/seam/components/DeviceDetails/DeviceDetails.js.map +1 -1
- package/lib/seam/components/DeviceDetails/DeviceInfo.d.ts +3 -3
- package/lib/seam/components/DeviceDetails/DeviceInfo.js +3 -1
- package/lib/seam/components/DeviceDetails/DeviceInfo.js.map +1 -1
- package/lib/seam/components/DeviceDetails/DeviceModel.d.ts +3 -3
- package/lib/seam/components/DeviceDetails/LockDeviceDetails.d.ts +2 -2
- package/lib/seam/components/DeviceDetails/LockDeviceDetails.js +5 -5
- package/lib/seam/components/DeviceDetails/LockDeviceDetails.js.map +1 -1
- package/lib/seam/components/DeviceDetails/NoiseSensorDeviceDetails.d.ts +2 -2
- package/lib/seam/components/DeviceDetails/NoiseSensorDeviceDetails.js.map +1 -1
- package/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.d.ts +2 -2
- package/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.js +3 -3
- package/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.js.map +1 -1
- package/lib/seam/components/DeviceTable/DeviceHealthBar.d.ts +3 -4
- package/lib/seam/components/DeviceTable/DeviceHealthBar.js.map +1 -1
- package/lib/seam/components/DeviceTable/DeviceRow.d.ts +4 -3
- package/lib/seam/components/DeviceTable/DeviceRow.js +2 -2
- package/lib/seam/components/DeviceTable/DeviceRow.js.map +1 -1
- package/lib/seam/components/DeviceTable/DeviceTable.d.ts +3 -6
- package/lib/seam/components/DeviceTable/DeviceTable.js +4 -2
- package/lib/seam/components/DeviceTable/DeviceTable.js.map +1 -1
- package/lib/seam/components/EditAccessCodeForm/EditAccessCodeForm.d.ts +1 -1
- package/lib/seam/components/EditAccessCodeForm/EditAccessCodeForm.js +2 -2
- package/lib/seam/components/EditAccessCodeForm/EditAccessCodeForm.js.map +1 -1
- package/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.d.ts +1 -1
- package/lib/seam/components/SupportedDeviceTable/HiddenDevicesOverlay.d.ts +1 -1
- package/lib/seam/components/SupportedDeviceTable/ShowAllDevicesButton.d.ts +1 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.d.ts +1 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js +2 -2
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js.map +1 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.d.ts +3 -3
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.js.map +1 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.d.ts +1 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.d.ts +1 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.d.ts +1 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.d.ts +1 -1
- package/lib/seam/components/SupportedDeviceTable/use-device-model.d.ts +2 -2
- package/lib/seam/components/SupportedDeviceTable/use-device-model.js +3 -4
- package/lib/seam/components/SupportedDeviceTable/use-device-model.js.map +1 -1
- package/lib/seam/components/SupportedDeviceTable/use-device-models.js +2 -4
- package/lib/seam/components/SupportedDeviceTable/use-device-models.js.map +1 -1
- package/lib/seam/components/SupportedDeviceTable/use-manufacturer.d.ts +2 -2
- package/lib/seam/components/SupportedDeviceTable/use-manufacturer.js +2 -3
- package/lib/seam/components/SupportedDeviceTable/use-manufacturer.js.map +1 -1
- package/lib/seam/components/SupportedDeviceTable/use-manufacturers.js +1 -3
- package/lib/seam/components/SupportedDeviceTable/use-manufacturers.js.map +1 -1
- package/lib/seam/components/common-props.d.ts +2 -2
- package/lib/seam/components/common-props.js.map +1 -1
- package/lib/seam/connect-webviews/use-create-connect-webview.d.ts +4 -3
- package/lib/seam/connect-webviews/use-create-connect-webview.js +3 -3
- package/lib/seam/connect-webviews/use-create-connect-webview.js.map +1 -1
- package/lib/seam/connected-accounts/use-connected-account.d.ts +3 -2
- package/lib/seam/connected-accounts/use-connected-account.js +2 -3
- package/lib/seam/connected-accounts/use-connected-account.js.map +1 -1
- package/lib/seam/devices/use-device-providers.d.ts +3 -2
- package/lib/seam/devices/use-device-providers.js.map +1 -1
- package/lib/seam/devices/use-device.d.ts +5 -4
- package/lib/seam/devices/use-device.js +2 -3
- package/lib/seam/devices/use-device.js.map +1 -1
- package/lib/seam/devices/use-devices.d.ts +4 -3
- package/lib/seam/devices/use-devices.js +2 -3
- package/lib/seam/devices/use-devices.js.map +1 -1
- package/lib/seam/events/use-events.d.ts +5 -4
- package/lib/seam/events/use-events.js +5 -5
- package/lib/seam/events/use-events.js.map +1 -1
- package/lib/seam/filters.d.ts +7 -7
- package/lib/seam/filters.js.map +1 -1
- package/lib/seam/locks/lock-device.d.ts +5 -0
- package/lib/seam/locks/lock-device.js +2 -0
- package/lib/seam/locks/lock-device.js.map +1 -0
- package/lib/seam/locks/use-toggle-lock.d.ts +16 -0
- package/lib/seam/locks/use-toggle-lock.js +59 -0
- package/lib/seam/locks/use-toggle-lock.js.map +1 -0
- package/lib/seam/noise-sensors/noise-sensor-device.d.ts +5 -0
- package/lib/seam/noise-sensors/noise-sensor-device.js +2 -0
- package/lib/seam/noise-sensors/noise-sensor-device.js.map +1 -0
- package/lib/seam/noise-sensors/use-noise-thresholds.d.ts +4 -3
- package/lib/seam/noise-sensors/use-noise-thresholds.js +2 -3
- package/lib/seam/noise-sensors/use-noise-thresholds.js.map +1 -1
- package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedule.d.ts +3 -2
- package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedule.js +2 -10
- package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedule.js.map +1 -1
- package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.d.ts +3 -2
- package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.js +3 -4
- package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.js.map +1 -1
- package/lib/seam/thermostats/climate-setting-schedules/use-create-climate-setting-schedule.d.ts +5 -3
- package/lib/seam/thermostats/climate-setting-schedules/use-create-climate-setting-schedule.js +10 -6
- package/lib/seam/thermostats/climate-setting-schedules/use-create-climate-setting-schedule.js.map +1 -1
- package/lib/seam/thermostats/climate-setting-schedules/use-delete-climate-setting-schedule.d.ts +5 -4
- package/lib/seam/thermostats/climate-setting-schedules/use-delete-climate-setting-schedule.js +13 -13
- package/lib/seam/thermostats/climate-setting-schedules/use-delete-climate-setting-schedule.js.map +1 -1
- package/lib/seam/thermostats/climate-setting-schedules/use-update-climate-setting-schedule.d.ts +5 -5
- package/lib/seam/thermostats/climate-setting-schedules/use-update-climate-setting-schedule.js +12 -17
- package/lib/seam/thermostats/climate-setting-schedules/use-update-climate-setting-schedule.js.map +1 -1
- package/lib/{temperature-bounds.d.ts → seam/thermostats/temperature-bounds.d.ts} +1 -1
- package/lib/{temperature-bounds.js → seam/thermostats/temperature-bounds.js} +4 -4
- package/lib/seam/thermostats/temperature-bounds.js.map +1 -0
- package/lib/seam/thermostats/thermostat-device.d.ts +17 -0
- package/lib/seam/thermostats/thermostat-device.js +2 -0
- package/lib/seam/thermostats/thermostat-device.js.map +1 -0
- package/lib/seam/thermostats/unit-conversion.d.ts +19 -0
- package/lib/seam/thermostats/unit-conversion.js +43 -0
- package/lib/seam/thermostats/unit-conversion.js.map +1 -0
- package/lib/seam/thermostats/use-cool-thermostat.d.ts +10 -4
- package/lib/seam/thermostats/use-cool-thermostat.js +34 -27
- package/lib/seam/thermostats/use-cool-thermostat.js.map +1 -1
- package/lib/seam/thermostats/use-heat-cool-thermostat.d.ts +10 -4
- package/lib/seam/thermostats/use-heat-cool-thermostat.js +34 -22
- package/lib/seam/thermostats/use-heat-cool-thermostat.js.map +1 -1
- package/lib/seam/thermostats/use-heat-thermostat.d.ts +10 -4
- package/lib/seam/thermostats/use-heat-thermostat.js +34 -27
- package/lib/seam/thermostats/use-heat-thermostat.js.map +1 -1
- package/lib/seam/thermostats/use-set-thermostat-fan-mode.d.ts +12 -0
- package/lib/seam/thermostats/use-set-thermostat-fan-mode.js +46 -0
- package/lib/seam/thermostats/use-set-thermostat-fan-mode.js.map +1 -0
- package/lib/seam/thermostats/use-set-thermostat-off.d.ts +10 -4
- package/lib/seam/thermostats/use-set-thermostat-off.js +36 -25
- package/lib/seam/thermostats/use-set-thermostat-off.js.map +1 -1
- package/lib/seam/thermostats/use-update-thermostat.d.ts +5 -5
- package/lib/seam/thermostats/use-update-thermostat.js +28 -27
- package/lib/seam/thermostats/use-update-thermostat.js.map +1 -1
- package/lib/seam/use-seam-client.d.ts +3 -3
- package/lib/seam/use-seam-client.js +5 -21
- package/lib/seam/use-seam-client.js.map +1 -1
- package/lib/seam/use-seam-query-result.d.ts +2 -2
- package/lib/ui/AccessCodeForm/AccessCodeForm.d.ts +5 -7
- package/lib/ui/AccessCodeForm/AccessCodeForm.js +9 -14
- package/lib/ui/AccessCodeForm/AccessCodeForm.js.map +1 -1
- package/lib/ui/AccessCodeForm/AccessCodeFormDatePicker.d.ts +1 -1
- package/lib/ui/AccessCodeForm/AccessCodeFormTimeZonePicker.d.ts +1 -1
- package/lib/ui/AccessCodeForm/AccessCodeFormTimes.d.ts +1 -1
- package/lib/ui/Checkbox.d.ts +1 -1
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.d.ts +2 -2
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.js +1 -1
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.js.map +1 -1
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormClimateSetting.d.ts +1 -1
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormClimateSetting.js +3 -3
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormClimateSetting.js.map +1 -1
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDefaultClimateSetting.d.ts +1 -1
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDefaultClimateSetting.js.map +1 -1
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDeviceSelect.d.ts +1 -1
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormNameAndSchedule.d.ts +1 -1
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormTimeZonePicker.d.ts +1 -1
- package/lib/ui/ClimateSettingForm/set-point-bounds.d.ts +4 -0
- package/lib/ui/ClimateSettingForm/set-point-bounds.js +17 -0
- package/lib/ui/ClimateSettingForm/set-point-bounds.js.map +1 -0
- package/lib/ui/DateTimePicker/DateTimePicker.d.ts +1 -1
- package/lib/ui/FormField.d.ts +1 -1
- package/lib/ui/IconButton.d.ts +1 -1
- package/lib/ui/LoadingToast/LoadingToast.d.ts +1 -1
- package/lib/ui/RadioField/Radio.d.ts +1 -1
- package/lib/ui/RadioField/RadioField.d.ts +1 -1
- package/lib/ui/Snackbar/Snackbar.d.ts +1 -1
- package/lib/ui/Spinner/Spinner.d.ts +1 -1
- package/lib/ui/Switch/Switch.d.ts +1 -1
- package/lib/ui/TabSet.d.ts +1 -1
- package/lib/ui/Table/EmptyPlaceholder.d.ts +1 -1
- package/lib/ui/Table/TableCell.d.ts +1 -1
- package/lib/ui/Table/TableFilterBar/TableFilterBar.d.ts +1 -1
- package/lib/ui/Table/TableFilterBar/TableFilterItem.d.ts +1 -1
- package/lib/ui/Table/TableRow.d.ts +1 -1
- package/lib/ui/TextButton.d.ts +1 -1
- package/lib/ui/TextField/SearchTextField.d.ts +1 -1
- package/lib/ui/TimeZonePicker/TimeZonePicker.d.ts +1 -1
- package/lib/ui/clipboard.d.ts +1 -1
- package/lib/ui/clipboard.js +2 -2
- package/lib/ui/clipboard.js.map +1 -1
- package/lib/ui/device/BatteryStatusIndicator.d.ts +7 -0
- package/lib/ui/device/{BatteryStatus.js → BatteryStatusIndicator.js} +2 -2
- package/lib/ui/device/BatteryStatusIndicator.js.map +1 -0
- package/lib/ui/device/DeviceImage.d.ts +2 -2
- package/lib/ui/device/LockStatus.d.ts +3 -3
- package/lib/ui/device/LockStatus.js +1 -1
- package/lib/ui/device/LockStatus.js.map +1 -1
- package/lib/ui/device/NoiseLevelStatus.d.ts +2 -2
- package/lib/ui/device/NoiseLevelStatus.js +4 -4
- package/lib/ui/device/NoiseLevelStatus.js.map +1 -1
- package/lib/ui/device/OnlineStatus.d.ts +4 -4
- package/lib/ui/device/OnlineStatus.js.map +1 -1
- package/lib/ui/layout/ContentHeader.d.ts +1 -1
- package/lib/ui/layout/DotDivider.d.ts +1 -1
- package/lib/ui/noise-sensor/NoiseSensorActivityList.d.ts +2 -2
- package/lib/ui/noise-sensor/NoiseSensorActivityList.js +4 -2
- package/lib/ui/noise-sensor/NoiseSensorActivityList.js.map +1 -1
- package/lib/ui/noise-sensor/NoiseSensorEventItem.d.ts +6 -3
- package/lib/ui/noise-sensor/NoiseSensorEventItem.js +4 -7
- package/lib/ui/noise-sensor/NoiseSensorEventItem.js.map +1 -1
- package/lib/ui/noise-sensor/NoiseThresholdsList.d.ts +2 -2
- package/lib/ui/noise-sensor/NoiseThresholdsList.js.map +1 -1
- package/lib/ui/thermostat/ClimateModeMenu.d.ts +2 -2
- package/lib/ui/thermostat/ClimateModeMenu.js.map +1 -1
- package/lib/ui/thermostat/ClimateSettingControlGroup.d.ts +2 -2
- package/lib/ui/thermostat/ClimateSettingControlGroup.js.map +1 -1
- package/lib/ui/thermostat/ClimateSettingStatus.d.ts +2 -2
- package/lib/ui/thermostat/ClimateSettingStatus.js +2 -2
- package/lib/ui/thermostat/ClimateSettingStatus.js.map +1 -1
- package/lib/ui/thermostat/FanModeMenu.d.ts +2 -2
- package/lib/ui/thermostat/FanModeMenu.js.map +1 -1
- package/lib/ui/thermostat/Temperature.d.ts +1 -1
- package/lib/ui/thermostat/TemperatureControl.d.ts +1 -1
- package/lib/ui/thermostat/TemperatureControlGroup.d.ts +2 -2
- package/lib/ui/thermostat/TemperatureControlGroup.js +1 -1
- package/lib/ui/thermostat/TemperatureControlGroup.js.map +1 -1
- package/lib/ui/thermostat/ThermoModeMenuOption.d.ts +1 -1
- package/lib/ui/thermostat/ThermostatCard.d.ts +2 -2
- package/lib/ui/thermostat/ThermostatCard.js +5 -4
- package/lib/ui/thermostat/ThermostatCard.js.map +1 -1
- package/lib/ui/thermostat/ThermostatSelect.d.ts +1 -1
- package/lib/ui/thermostat/ThermostatSelect.js +2 -2
- package/lib/ui/thermostat/ThermostatSelect.js.map +1 -1
- package/lib/ui/typography/Title.d.ts +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +8 -9
- package/src/index.scss +1 -1
- package/src/lib/object.ts +13 -0
- package/src/lib/seam/SeamProvider.tsx +9 -4
- package/src/lib/seam/access-codes/use-access-code.ts +10 -16
- package/src/lib/seam/access-codes/use-access-codes.ts +11 -18
- package/src/lib/seam/access-codes/use-create-access-code.ts +21 -16
- package/src/lib/seam/access-codes/use-delete-access-code.ts +22 -22
- package/src/lib/seam/access-codes/use-generate-access-code-code.ts +17 -21
- package/src/lib/seam/access-codes/use-update-access-code.ts +33 -25
- package/src/lib/seam/client-sessions/use-client-session.ts +5 -10
- package/src/lib/seam/components/AccessCodeDetails/AccessCodeDetails.tsx +36 -23
- package/src/lib/seam/components/AccessCodeDetails/AccessCodeDevice.tsx +10 -7
- package/src/lib/seam/components/AccessCodeTable/AccessCodeHealthBar.tsx +2 -3
- package/src/lib/seam/components/AccessCodeTable/AccessCodeMainIcon.tsx +3 -2
- package/src/lib/seam/components/AccessCodeTable/AccessCodeMenu.tsx +5 -4
- package/src/lib/seam/components/AccessCodeTable/AccessCodeRow.tsx +3 -2
- package/src/lib/seam/components/AccessCodeTable/AccessCodeTable.tsx +3 -7
- package/src/lib/seam/components/AccessCodeTable/CodeDetails.tsx +12 -8
- package/src/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleCard.tsx +4 -4
- package/src/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.tsx +3 -3
- package/src/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDeviceBar.tsx +6 -4
- package/src/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRow.tsx +3 -2
- package/src/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRowDetails.tsx +1 -1
- package/src/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleTable.tsx +3 -6
- package/src/lib/seam/components/ConnectAccountButton/ConnectAccountButton.tsx +2 -2
- package/src/lib/seam/components/CreateAccessCodeForm/CreateAccessCodeForm.tsx +20 -16
- package/src/lib/seam/components/CreateClimateSettingScheduleForm/CreateClimateSettingScheduleForm.tsx +1 -1
- package/src/lib/seam/components/DeviceDetails/DeviceDetails.tsx +3 -2
- package/src/lib/seam/components/DeviceDetails/DeviceInfo.tsx +5 -3
- package/src/lib/seam/components/DeviceDetails/DeviceModel.tsx +2 -2
- package/src/lib/seam/components/DeviceDetails/LockDeviceDetails.tsx +6 -6
- package/src/lib/seam/components/DeviceDetails/NoiseSensorDeviceDetails.tsx +1 -1
- package/src/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.tsx +7 -4
- package/src/lib/seam/components/DeviceTable/DeviceHealthBar.tsx +6 -3
- package/src/lib/seam/components/DeviceTable/DeviceRow.tsx +5 -7
- package/src/lib/seam/components/DeviceTable/DeviceTable.tsx +7 -14
- package/src/lib/seam/components/EditAccessCodeForm/EditAccessCodeForm.tsx +6 -7
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.tsx +3 -4
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.tsx +3 -2
- package/src/lib/seam/components/SupportedDeviceTable/use-device-model.ts +9 -14
- package/src/lib/seam/components/SupportedDeviceTable/use-device-models.ts +5 -9
- package/src/lib/seam/components/SupportedDeviceTable/use-manufacturer.ts +7 -12
- package/src/lib/seam/components/SupportedDeviceTable/use-manufacturers.ts +4 -8
- package/src/lib/seam/components/common-props.tsx +8 -4
- package/src/lib/seam/connect-webviews/use-create-connect-webview.ts +15 -17
- package/src/lib/seam/connected-accounts/use-connected-account.ts +17 -21
- package/src/lib/seam/devices/use-device-providers.ts +8 -11
- package/src/lib/seam/devices/use-device.ts +9 -18
- package/src/lib/seam/devices/use-devices.ts +20 -26
- package/src/lib/seam/events/use-events.ts +12 -14
- package/src/lib/seam/filters.ts +9 -8
- package/src/lib/seam/locks/lock-device.ts +9 -0
- package/src/lib/seam/locks/use-toggle-lock.ts +103 -0
- package/src/lib/seam/noise-sensors/noise-sensor-device.ts +10 -0
- package/src/lib/seam/noise-sensors/use-noise-thresholds.ts +12 -15
- package/src/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedule.ts +10 -23
- package/src/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.ts +13 -13
- package/src/lib/seam/thermostats/climate-setting-schedules/use-create-climate-setting-schedule.ts +30 -25
- package/src/lib/seam/thermostats/climate-setting-schedules/use-delete-climate-setting-schedule.ts +26 -28
- package/src/lib/seam/thermostats/climate-setting-schedules/use-update-climate-setting-schedule.ts +32 -41
- package/src/lib/{temperature-bounds.ts → seam/thermostats/temperature-bounds.ts} +8 -5
- package/src/lib/seam/thermostats/thermostat-device.ts +43 -0
- package/src/lib/seam/thermostats/unit-conversion.ts +89 -0
- package/src/lib/seam/thermostats/use-cool-thermostat.ts +77 -47
- package/src/lib/seam/thermostats/use-heat-cool-thermostat.ts +89 -40
- package/src/lib/seam/thermostats/use-heat-thermostat.ts +77 -47
- package/src/lib/seam/thermostats/use-set-thermostat-fan-mode.ts +95 -0
- package/src/lib/seam/thermostats/use-set-thermostat-off.ts +64 -40
- package/src/lib/seam/thermostats/use-update-thermostat.ts +47 -49
- package/src/lib/seam/use-seam-client.ts +11 -22
- package/src/lib/seam/use-seam-query-result.ts +2 -2
- package/src/lib/ui/AccessCodeForm/AccessCodeForm.tsx +18 -24
- package/src/lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.tsx +4 -4
- package/src/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormClimateSetting.tsx +6 -3
- package/src/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDefaultClimateSetting.tsx +1 -1
- package/src/lib/ui/ClimateSettingForm/set-point-bounds.ts +31 -0
- package/src/lib/ui/clipboard.ts +1 -1
- package/src/lib/ui/device/{BatteryStatus.tsx → BatteryStatusIndicator.tsx} +10 -5
- package/src/lib/ui/device/DeviceImage.tsx +2 -2
- package/src/lib/ui/device/LockStatus.tsx +3 -2
- package/src/lib/ui/device/NoiseLevelStatus.tsx +3 -3
- package/src/lib/ui/device/OnlineStatus.tsx +3 -3
- package/src/lib/ui/noise-sensor/NoiseSensorActivityList.tsx +15 -6
- package/src/lib/ui/noise-sensor/NoiseSensorEventItem.tsx +13 -9
- package/src/lib/ui/noise-sensor/NoiseThresholdsList.tsx +4 -3
- package/src/lib/ui/thermostat/ClimateModeMenu.tsx +1 -2
- package/src/lib/ui/thermostat/ClimateSettingControlGroup.tsx +1 -2
- package/src/lib/ui/thermostat/ClimateSettingStatus.tsx +2 -3
- package/src/lib/ui/thermostat/FanModeMenu.tsx +1 -2
- package/src/lib/ui/thermostat/TemperatureControlGroup.tsx +2 -2
- package/src/lib/ui/thermostat/ThermostatCard.tsx +11 -8
- package/src/lib/ui/thermostat/ThermostatSelect.tsx +4 -10
- package/src/lib/version.ts +1 -1
- package/lib/seam/devices/use-toggle-lock.d.ts +0 -5
- package/lib/seam/devices/use-toggle-lock.js +0 -56
- package/lib/seam/devices/use-toggle-lock.js.map +0 -1
- package/lib/seam/error-handlers.d.ts +0 -5
- package/lib/seam/error-handlers.js +0 -12
- package/lib/seam/error-handlers.js.map +0 -1
- package/lib/seam/thermostats/use-update-fan-mode.d.ts +0 -6
- package/lib/seam/thermostats/use-update-fan-mode.js +0 -42
- package/lib/seam/thermostats/use-update-fan-mode.js.map +0 -1
- package/lib/set-point-bounds.d.ts +0 -4
- package/lib/set-point-bounds.js +0 -24
- package/lib/set-point-bounds.js.map +0 -1
- package/lib/temperature-bounds.js.map +0 -1
- package/lib/ui/device/BatteryStatus.d.ts +0 -7
- package/lib/ui/device/BatteryStatus.js.map +0 -1
- package/src/lib/seam/devices/use-toggle-lock.ts +0 -84
- package/src/lib/seam/error-handlers.ts +0 -19
- package/src/lib/seam/thermostats/use-update-fan-mode.ts +0 -81
- package/src/lib/set-point-bounds.ts +0 -39
|
@@ -1,64 +1,64 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
SeamHttpApiError,
|
|
3
|
+
ThermostatsUpdateBody,
|
|
4
|
+
} from '@seamapi/http/connect'
|
|
5
|
+
import type { Device } from '@seamapi/types/connect'
|
|
1
6
|
import {
|
|
2
7
|
useMutation,
|
|
3
8
|
type UseMutationResult,
|
|
4
9
|
useQueryClient,
|
|
5
10
|
} from '@tanstack/react-query'
|
|
6
|
-
import type {
|
|
7
|
-
SeamError,
|
|
8
|
-
ThermostatDevice,
|
|
9
|
-
ThermostatsListResponse,
|
|
10
|
-
ThermostatUpdateRequest,
|
|
11
|
-
} from 'seamapi'
|
|
12
11
|
|
|
12
|
+
import { shake } from 'lib/object.js'
|
|
13
13
|
import { NullSeamClientError, useSeamClient } from 'lib/seam/use-seam-client.js'
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
type
|
|
15
|
+
export type UseUpdateThermostatParams = never
|
|
16
|
+
|
|
17
|
+
export type UseUpdateThermostatData = undefined
|
|
18
|
+
|
|
19
|
+
export type UseUpdateThermostatMutationVariables = ThermostatsUpdateBody
|
|
18
20
|
|
|
19
21
|
export function useUpdateThermostat(): UseMutationResult<
|
|
20
22
|
UseUpdateThermostatData,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
SeamHttpApiError,
|
|
24
|
+
UseUpdateThermostatMutationVariables
|
|
23
25
|
> {
|
|
24
26
|
const { client } = useSeamClient()
|
|
25
27
|
const queryClient = useQueryClient()
|
|
26
28
|
|
|
27
29
|
return useMutation<
|
|
28
30
|
UseUpdateThermostatData,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
SeamHttpApiError,
|
|
32
|
+
UseUpdateThermostatMutationVariables
|
|
31
33
|
>({
|
|
32
|
-
mutationFn: async (
|
|
34
|
+
mutationFn: async (variables) => {
|
|
33
35
|
if (client === null) throw new NullSeamClientError()
|
|
34
|
-
|
|
35
|
-
return await client.thermostats.update(mutationParams)
|
|
36
|
+
await client.thermostats.update(variables)
|
|
36
37
|
},
|
|
37
38
|
onSuccess: (_data, variables) => {
|
|
38
|
-
queryClient.setQueryData<
|
|
39
|
+
queryClient.setQueryData<Device | null>(
|
|
39
40
|
['devices', 'get', { device_id: variables.device_id }],
|
|
40
|
-
(
|
|
41
|
-
if (
|
|
41
|
+
(device) => {
|
|
42
|
+
if (device == null) {
|
|
42
43
|
return
|
|
43
44
|
}
|
|
44
|
-
|
|
45
|
-
return getUpdatedThermostat(thermostat, variables)
|
|
45
|
+
return getUpdatedDevice(device, variables)
|
|
46
46
|
}
|
|
47
47
|
)
|
|
48
48
|
|
|
49
|
-
queryClient.setQueryData<
|
|
49
|
+
queryClient.setQueryData<Device[]>(
|
|
50
50
|
['devices', 'list', { device_id: variables.device_id }],
|
|
51
|
-
(
|
|
52
|
-
if (
|
|
51
|
+
(devices): Device[] => {
|
|
52
|
+
if (devices == null) {
|
|
53
53
|
return []
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
return
|
|
57
|
-
if (
|
|
58
|
-
return
|
|
56
|
+
return devices.map((device) => {
|
|
57
|
+
if (device.device_id === variables.device_id) {
|
|
58
|
+
return getUpdatedDevice(device, variables)
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
return
|
|
61
|
+
return device
|
|
62
62
|
})
|
|
63
63
|
}
|
|
64
64
|
)
|
|
@@ -66,27 +66,25 @@ export function useUpdateThermostat(): UseMutationResult<
|
|
|
66
66
|
})
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
variables:
|
|
72
|
-
):
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
properties
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
: true,
|
|
87
|
-
|
|
88
|
-
...variables.default_climate_setting,
|
|
69
|
+
const getUpdatedDevice = (
|
|
70
|
+
device: Device,
|
|
71
|
+
variables: UseUpdateThermostatMutationVariables
|
|
72
|
+
): Device => {
|
|
73
|
+
const { properties } = device
|
|
74
|
+
if (
|
|
75
|
+
'default_climate_setting' in properties &&
|
|
76
|
+
properties.default_climate_setting != null
|
|
77
|
+
) {
|
|
78
|
+
return {
|
|
79
|
+
...device,
|
|
80
|
+
properties: {
|
|
81
|
+
...properties,
|
|
82
|
+
default_climate_setting: {
|
|
83
|
+
...properties.default_climate_setting,
|
|
84
|
+
...shake(variables.default_climate_setting),
|
|
85
|
+
},
|
|
89
86
|
},
|
|
90
|
-
}
|
|
87
|
+
}
|
|
91
88
|
}
|
|
89
|
+
return device
|
|
92
90
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import { SeamHttp } from '@seamapi/http/connect'
|
|
1
2
|
import { useQuery } from '@tanstack/react-query'
|
|
2
3
|
import { useEffect } from 'react'
|
|
3
|
-
import { Seam } from 'seamapi'
|
|
4
4
|
import { v4 as uuidv4 } from 'uuid'
|
|
5
5
|
|
|
6
6
|
import { useSeamContext } from 'lib/seam/SeamProvider.js'
|
|
7
7
|
|
|
8
8
|
export function useSeamClient(): {
|
|
9
|
-
client:
|
|
10
|
-
|
|
9
|
+
client: SeamHttp | null
|
|
10
|
+
isPending: boolean
|
|
11
11
|
isError: boolean
|
|
12
12
|
error: unknown
|
|
13
13
|
} {
|
|
@@ -22,7 +22,7 @@ export function useSeamClient(): {
|
|
|
22
22
|
clientSessionToken != null ? '' : context.userIdentifierKey
|
|
23
23
|
)
|
|
24
24
|
|
|
25
|
-
const {
|
|
25
|
+
const { isPending, isError, error, data } = useQuery<SeamHttp>({
|
|
26
26
|
queryKey: [
|
|
27
27
|
'client',
|
|
28
28
|
{
|
|
@@ -37,11 +37,10 @@ export function useSeamClient(): {
|
|
|
37
37
|
if (client != null) return client
|
|
38
38
|
|
|
39
39
|
if (clientSessionToken != null) {
|
|
40
|
-
return
|
|
41
|
-
...clientOptions,
|
|
42
|
-
apiKey: null,
|
|
40
|
+
return SeamHttp.fromClientSessionToken(
|
|
43
41
|
clientSessionToken,
|
|
44
|
-
|
|
42
|
+
clientOptions
|
|
43
|
+
)
|
|
45
44
|
}
|
|
46
45
|
|
|
47
46
|
if (publishableKey == null) {
|
|
@@ -50,25 +49,15 @@ export function useSeamClient(): {
|
|
|
50
49
|
)
|
|
51
50
|
}
|
|
52
51
|
|
|
53
|
-
|
|
54
|
-
...clientOptions,
|
|
52
|
+
return await SeamHttp.fromPublishableKey(
|
|
55
53
|
publishableKey,
|
|
56
54
|
userIdentifierKey,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (!res.ok || res.client_session?.token == null) {
|
|
60
|
-
throw new Error('Failed to get client session token')
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return new Seam({
|
|
64
|
-
...clientOptions,
|
|
65
|
-
apiKey: null,
|
|
66
|
-
clientSessionToken: res.client_session.token,
|
|
67
|
-
})
|
|
55
|
+
clientOptions
|
|
56
|
+
)
|
|
68
57
|
},
|
|
69
58
|
})
|
|
70
59
|
|
|
71
|
-
return { client: data ?? null,
|
|
60
|
+
return { client: data ?? null, isPending, isError, error }
|
|
72
61
|
}
|
|
73
62
|
|
|
74
63
|
export class NullSeamClientError extends Error {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { SeamHttpApiError } from '@seamapi/http/connect'
|
|
1
2
|
import type { UseQueryResult } from '@tanstack/react-query'
|
|
2
|
-
import type { SeamError } from 'seamapi'
|
|
3
3
|
|
|
4
4
|
export type UseSeamQueryResult<Field extends string, ResponsePayload> = Omit<
|
|
5
|
-
UseQueryResult<ResponsePayload,
|
|
5
|
+
UseQueryResult<ResponsePayload, SeamHttpApiError>,
|
|
6
6
|
'data'
|
|
7
7
|
> & { [key in Field]?: ResponsePayload }
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
+
import type { AccessCode, Device } from '@seamapi/types/connect'
|
|
1
2
|
import classNames from 'classnames'
|
|
2
3
|
import { DateTime } from 'luxon'
|
|
3
4
|
import { useState } from 'react'
|
|
4
5
|
import { useForm } from 'react-hook-form'
|
|
5
|
-
import { type AccessCode, type CommonDevice, isLockDevice } from 'seamapi'
|
|
6
6
|
|
|
7
7
|
import { getSystemTimeZone } from 'lib/dates.js'
|
|
8
|
-
import type { UseAccessCodeData } from 'lib/seam/access-codes/use-access-code.js'
|
|
9
8
|
import { useGenerateAccessCodeCode } from 'lib/seam/access-codes/use-generate-access-code-code.js'
|
|
10
|
-
import type { UseDeviceData } from 'lib/seam/devices/use-device.js'
|
|
11
9
|
import { AccessCodeFormDatePicker } from 'lib/ui/AccessCodeForm/AccessCodeFormDatePicker.js'
|
|
12
10
|
import { AccessCodeFormTimes } from 'lib/ui/AccessCodeForm/AccessCodeFormTimes.js'
|
|
13
11
|
import { AccessCodeFormTimeZonePicker } from 'lib/ui/AccessCodeForm/AccessCodeFormTimeZonePicker.js'
|
|
@@ -23,7 +21,7 @@ export interface AccessCodeFormSubmitData {
|
|
|
23
21
|
name: string
|
|
24
22
|
code: string
|
|
25
23
|
type: AccessCode['type']
|
|
26
|
-
device:
|
|
24
|
+
device: Device
|
|
27
25
|
startDate: string
|
|
28
26
|
endDate: string
|
|
29
27
|
timeZone: string
|
|
@@ -35,8 +33,8 @@ export interface ResponseErrors {
|
|
|
35
33
|
}
|
|
36
34
|
|
|
37
35
|
export interface AccessCodeFormProps {
|
|
38
|
-
accessCode?:
|
|
39
|
-
device:
|
|
36
|
+
accessCode?: AccessCode
|
|
37
|
+
device: Device
|
|
40
38
|
isSubmitting: boolean
|
|
41
39
|
onSubmit: (data: AccessCodeFormSubmitData) => void
|
|
42
40
|
responseErrors: ResponseErrors | null
|
|
@@ -115,7 +113,7 @@ function Content({
|
|
|
115
113
|
})
|
|
116
114
|
const [timeZonePickerVisible, toggleTimeZonePicker] = useToggle()
|
|
117
115
|
|
|
118
|
-
const {
|
|
116
|
+
const { isPending: isGeneratingCode, mutate: generateCode } =
|
|
119
117
|
useGenerateAccessCodeCode()
|
|
120
118
|
|
|
121
119
|
const submit = (): void => {}
|
|
@@ -158,10 +156,8 @@ function Content({
|
|
|
158
156
|
device_id: device.device_id,
|
|
159
157
|
},
|
|
160
158
|
{
|
|
161
|
-
onSuccess: (
|
|
162
|
-
|
|
163
|
-
setValue('code', generatedCode)
|
|
164
|
-
}
|
|
159
|
+
onSuccess: (generatedCode) => {
|
|
160
|
+
setValue('code', generatedCode)
|
|
165
161
|
},
|
|
166
162
|
}
|
|
167
163
|
)
|
|
@@ -306,13 +302,9 @@ function Content({
|
|
|
306
302
|
}
|
|
307
303
|
|
|
308
304
|
const validateCodeLength = (
|
|
309
|
-
device:
|
|
305
|
+
device: Device,
|
|
310
306
|
value: string
|
|
311
307
|
): boolean | string => {
|
|
312
|
-
if (!isLockDevice(device)) {
|
|
313
|
-
return true
|
|
314
|
-
}
|
|
315
|
-
|
|
316
308
|
if (device.properties.supported_code_lengths == null) {
|
|
317
309
|
return true
|
|
318
310
|
}
|
|
@@ -324,11 +316,7 @@ const validateCodeLength = (
|
|
|
324
316
|
return t.codeLengthError(device.properties.supported_code_lengths.join(', '))
|
|
325
317
|
}
|
|
326
318
|
|
|
327
|
-
const getCodeLengthRequirement = (device:
|
|
328
|
-
if (!isLockDevice(device)) {
|
|
329
|
-
return null
|
|
330
|
-
}
|
|
331
|
-
|
|
319
|
+
const getCodeLengthRequirement = (device: Device): string | null => {
|
|
332
320
|
const codeLengths = device.properties.supported_code_lengths
|
|
333
321
|
if (codeLengths == null) {
|
|
334
322
|
return null
|
|
@@ -355,8 +343,8 @@ const isSequential = (numbers: string): boolean =>
|
|
|
355
343
|
sequentialNumbers.includes(numbers)
|
|
356
344
|
|
|
357
345
|
const getAccessCodeDate = (
|
|
358
|
-
|
|
359
|
-
accessCode?:
|
|
346
|
+
key: 'starts_at' | 'ends_at',
|
|
347
|
+
accessCode?: AccessCode
|
|
360
348
|
): DateTime | null => {
|
|
361
349
|
if (accessCode == null) {
|
|
362
350
|
return null
|
|
@@ -366,7 +354,13 @@ const getAccessCodeDate = (
|
|
|
366
354
|
return null
|
|
367
355
|
}
|
|
368
356
|
|
|
369
|
-
|
|
357
|
+
const date = accessCode[key]
|
|
358
|
+
|
|
359
|
+
if (date == null) {
|
|
360
|
+
return null
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
return DateTime.fromISO(date)
|
|
370
364
|
}
|
|
371
365
|
|
|
372
366
|
const getNow = (timeZone: string): DateTime => DateTime.now().setZone(timeZone)
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import classNames from 'classnames'
|
|
2
2
|
import { useEffect, useState } from 'react'
|
|
3
3
|
import { useForm } from 'react-hook-form'
|
|
4
|
+
|
|
5
|
+
import { getSystemTimeZone } from 'lib/dates.js'
|
|
6
|
+
import { useSeamClient } from 'lib/index.js'
|
|
4
7
|
import {
|
|
5
8
|
type ClimateSetting,
|
|
6
9
|
type HvacModeSetting,
|
|
7
10
|
isThermostatDevice,
|
|
8
|
-
} from '
|
|
9
|
-
|
|
10
|
-
import { getSystemTimeZone } from 'lib/dates.js'
|
|
11
|
-
import { useSeamClient } from 'lib/index.js'
|
|
11
|
+
} from 'lib/seam/thermostats/thermostat-device.js'
|
|
12
12
|
import { ClimateSettingScheduleFormClimateSetting } from 'lib/ui/ClimateSettingForm/ClimateSettingScheduleFormClimateSetting.js'
|
|
13
13
|
import { ClimateSettingScheduleFormDefaultClimateSetting } from 'lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDefaultClimateSetting.js'
|
|
14
14
|
import { ClimateSettingScheduleFormDeviceSelect } from 'lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDeviceSelect.js'
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { type Control, Controller } from 'react-hook-form'
|
|
2
|
-
import { isThermostatDevice } from 'seamapi'
|
|
3
2
|
|
|
4
3
|
import { useDevice } from 'lib/seam/devices/use-device.js'
|
|
5
|
-
import {
|
|
4
|
+
import { isThermostatDevice } from 'lib/seam/thermostats/thermostat-device.js'
|
|
6
5
|
import { Button } from 'lib/ui/Button.js'
|
|
7
6
|
import type { ClimateSettingScheduleFormFields } from 'lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.js'
|
|
7
|
+
import {
|
|
8
|
+
getSetPointBounds,
|
|
9
|
+
type SetPointBounds,
|
|
10
|
+
} from 'lib/ui/ClimateSettingForm/set-point-bounds.js'
|
|
8
11
|
import { FormField } from 'lib/ui/FormField.js'
|
|
9
12
|
import { InputLabel } from 'lib/ui/InputLabel.js'
|
|
10
13
|
import { ContentHeader } from 'lib/ui/layout/ContentHeader.js'
|
|
@@ -34,7 +37,7 @@ export function ClimateSettingScheduleFormClimateSetting({
|
|
|
34
37
|
if (device == null) return <></>
|
|
35
38
|
if (!isThermostatDevice(device)) return <></>
|
|
36
39
|
|
|
37
|
-
const setPointBounds = getSetPointBounds(device
|
|
40
|
+
const setPointBounds = getSetPointBounds(device)
|
|
38
41
|
|
|
39
42
|
return (
|
|
40
43
|
<>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState } from 'react'
|
|
2
|
-
import type { HvacModeSetting } from 'seamapi'
|
|
3
2
|
|
|
4
3
|
import { useDevice } from 'lib/seam/devices/use-device.js'
|
|
4
|
+
import type { HvacModeSetting } from 'lib/seam/thermostats/thermostat-device.js'
|
|
5
5
|
import { Button } from 'lib/ui/Button.js'
|
|
6
6
|
import { InputLabel } from 'lib/ui/InputLabel.js'
|
|
7
7
|
import { ContentHeader } from 'lib/ui/layout/ContentHeader.js'
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ThermostatDevice } from 'lib/seam/thermostats/thermostat-device.js'
|
|
2
|
+
import type { TemperatureControlGroupProps } from 'lib/ui/thermostat/TemperatureControlGroup.js'
|
|
3
|
+
|
|
4
|
+
export type SetPointBounds = Partial<
|
|
5
|
+
Pick<
|
|
6
|
+
TemperatureControlGroupProps,
|
|
7
|
+
'minCool' | 'maxCool' | 'minHeat' | 'maxHeat' | 'delta'
|
|
8
|
+
>
|
|
9
|
+
>
|
|
10
|
+
|
|
11
|
+
export const getSetPointBounds = (device: ThermostatDevice): SetPointBounds => {
|
|
12
|
+
const { properties } = device
|
|
13
|
+
|
|
14
|
+
const setPointBounds: SetPointBounds = {}
|
|
15
|
+
|
|
16
|
+
if (properties.is_cooling_available) {
|
|
17
|
+
setPointBounds.minCool = properties.min_cooling_set_point_fahrenheit
|
|
18
|
+
setPointBounds.maxCool = properties.max_cooling_set_point_fahrenheit
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (properties.is_heating_available) {
|
|
22
|
+
setPointBounds.minHeat = properties.min_heating_set_point_fahrenheit
|
|
23
|
+
setPointBounds.maxHeat = properties.max_heating_set_point_fahrenheit
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (properties.is_cooling_available && properties.is_heating_available) {
|
|
27
|
+
setPointBounds.delta = properties.min_heating_cooling_delta_fahrenheit
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return setPointBounds
|
|
31
|
+
}
|
package/src/lib/ui/clipboard.ts
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Device } from '@seamapi/types/connect'
|
|
2
2
|
|
|
3
3
|
import { BatteryLevelCriticalIcon } from 'lib/icons/BatteryLevelCritical.js'
|
|
4
4
|
import { BatteryLevelFullIcon } from 'lib/icons/BatteryLevelFull.js'
|
|
5
5
|
import { BatteryLevelHighIcon } from 'lib/icons/BatteryLevelHigh.js'
|
|
6
6
|
import { BatteryLevelLowIcon } from 'lib/icons/BatteryLevelLow.js'
|
|
7
7
|
|
|
8
|
-
interface
|
|
9
|
-
device:
|
|
8
|
+
interface BatteryStatusIndicatorProps {
|
|
9
|
+
device: Device
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
// UPSTREAM: Missing BatteryStatusIndicator type in @seamapi/types/connect.
|
|
13
|
+
type BatteryStatus = 'low' | 'full' | 'critical' | 'good'
|
|
14
|
+
|
|
15
|
+
export function BatteryStatusIndicator(
|
|
16
|
+
props: BatteryStatusIndicatorProps
|
|
17
|
+
): JSX.Element {
|
|
13
18
|
return (
|
|
14
19
|
<div className='seam-battery-status'>
|
|
15
20
|
<Content
|
|
@@ -21,7 +26,7 @@ export function BatteryStatus(props: BatteryStatusProps): JSX.Element {
|
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
function Content(props: {
|
|
24
|
-
status:
|
|
29
|
+
status: BatteryStatus | null | undefined
|
|
25
30
|
level: number | null | undefined
|
|
26
31
|
}): JSX.Element | null {
|
|
27
32
|
const { status, level } = props
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import type { Device } from '@seamapi/types/connect'
|
|
1
2
|
import type { HTMLAttributes } from 'react'
|
|
2
|
-
import type { CommonDevice } from 'seamapi'
|
|
3
3
|
|
|
4
4
|
export function DeviceImage(
|
|
5
5
|
props: {
|
|
6
|
-
device:
|
|
6
|
+
device: Device
|
|
7
7
|
} & HTMLAttributes<HTMLImageElement>
|
|
8
8
|
): JSX.Element {
|
|
9
9
|
const { device, ...imageProps } = props
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { Device } from '@seamapi/types/connect'
|
|
2
2
|
|
|
3
3
|
import { LockLockedIcon } from 'lib/icons/LockLocked.js'
|
|
4
4
|
import { LockUnlockedIcon } from 'lib/icons/LockUnlocked.js'
|
|
5
|
+
import { isLockDevice } from 'lib/seam/locks/lock-device.js'
|
|
5
6
|
|
|
6
7
|
interface LockStatusProps {
|
|
7
|
-
device:
|
|
8
|
+
device: Device
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
export function LockStatus(props: LockStatusProps): JSX.Element | null {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import classNames from 'classnames'
|
|
2
|
-
import type { NoiseSensorDevice } from 'seamapi'
|
|
3
2
|
|
|
4
3
|
import { NoiseLevelsIcon } from 'lib/icons/NoiseLevels.js'
|
|
5
4
|
import { NoiseLevelsRedIcon } from 'lib/icons/NoiseLevelsRed.js'
|
|
5
|
+
import type { NoiseSensorDevice } from 'lib/seam/noise-sensors/noise-sensor-device.js'
|
|
6
6
|
|
|
7
7
|
interface NoiseLevelStatusProps {
|
|
8
8
|
device: NoiseSensorDevice
|
|
@@ -32,14 +32,14 @@ export function NoiseLevelStatus({
|
|
|
32
32
|
)
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
const toNoiseString = (value: number | string | undefined): string => {
|
|
36
36
|
if (typeof value === 'string' || typeof value === 'number') {
|
|
37
37
|
return `${Number(value).toFixed(0)} ${t.decibel}`
|
|
38
38
|
}
|
|
39
39
|
return t.unknown
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
const getNoiseLevel = (device: NoiseSensorDevice): string => {
|
|
43
43
|
const isMinut = device.device_type === 'minut_sensor'
|
|
44
44
|
const isNoiseAware = device.device_type === 'noiseaware_activity_zone'
|
|
45
45
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Device } from '@seamapi/types/connect'
|
|
2
2
|
|
|
3
3
|
import { OnlineStatusAccountOfflineIcon } from 'lib/icons/OnlineStatusAccountOffline.js'
|
|
4
4
|
import { OnlineStatusDeviceOfflineIcon } from 'lib/icons/OnlineStatusDeviceOffline.js'
|
|
5
5
|
import { OnlineStatusOnlineIcon } from 'lib/icons/OnlineStatusOnline.js'
|
|
6
6
|
|
|
7
7
|
interface OnlineStatusProps {
|
|
8
|
-
device:
|
|
8
|
+
device: Device
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export function OnlineStatus(props: OnlineStatusProps): JSX.Element {
|
|
@@ -50,7 +50,7 @@ function AccountOnlineContent(props: { isOnline: boolean }): JSX.Element {
|
|
|
50
50
|
)
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
export const isDeviceAccountOffline = (device:
|
|
53
|
+
export const isDeviceAccountOffline = (device: Device): boolean =>
|
|
54
54
|
device.errors.filter((error) => error.error_code === 'account_disconnected')
|
|
55
55
|
.length > 0
|
|
56
56
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { SeamEvent } from '@seamapi/types/connect'
|
|
1
2
|
import { useState } from 'react'
|
|
2
|
-
import type { NoiseSensorDevice } from 'seamapi'
|
|
3
3
|
|
|
4
4
|
import { useEvents } from 'lib/seam/events/use-events.js'
|
|
5
|
+
import type { NoiseSensorDevice } from 'lib/seam/noise-sensors/noise-sensor-device.js'
|
|
5
6
|
import { NoiseSensorEventItem } from 'lib/ui/noise-sensor/NoiseSensorEventItem.js'
|
|
6
7
|
import { useNow } from 'lib/ui/use-now.js'
|
|
7
8
|
|
|
@@ -15,11 +16,19 @@ export function NoiseSensorActivityList({
|
|
|
15
16
|
const now = useNow()
|
|
16
17
|
const [mountedAt] = useState(now)
|
|
17
18
|
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
const result = useEvents(
|
|
20
|
+
{
|
|
21
|
+
device_id: device.device_id,
|
|
22
|
+
event_type: 'noise_sensor.noise_threshold_triggered',
|
|
23
|
+
since: mountedAt.minus({ months: 1 }).toString(),
|
|
24
|
+
},
|
|
25
|
+
{ refetchInterval: 30_000 }
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
// UPSTREAM: seam.events.list should return better types.
|
|
29
|
+
const events = result.events as Array<
|
|
30
|
+
Extract<SeamEvent, { event_type: 'noise_sensor.noise_threshold_triggered' }>
|
|
31
|
+
>
|
|
23
32
|
|
|
24
33
|
return (
|
|
25
34
|
<div className='seam-noise-sensor-activity-list'>
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
import type { SeamEvent } from '@seamapi/types/connect'
|
|
1
2
|
import { DateTime } from 'luxon'
|
|
2
|
-
import type { Event } from 'seamapi'
|
|
3
3
|
|
|
4
4
|
import { ClockIcon } from 'lib/icons/Clock.js'
|
|
5
5
|
|
|
6
|
+
type NoiseSensorNoiseThresholdTriggeredEvent = Extract<
|
|
7
|
+
SeamEvent,
|
|
8
|
+
{ event_type: 'noise_sensor.noise_threshold_triggered' }
|
|
9
|
+
>
|
|
10
|
+
|
|
6
11
|
interface NoiseSensorEventItemProps {
|
|
7
|
-
event:
|
|
12
|
+
event: NoiseSensorNoiseThresholdTriggeredEvent
|
|
8
13
|
}
|
|
9
14
|
|
|
10
15
|
export function NoiseSensorEventItem({
|
|
@@ -40,16 +45,15 @@ export function NoiseSensorEventItem({
|
|
|
40
45
|
)
|
|
41
46
|
}
|
|
42
47
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
48
|
+
const getContextSublabel = (
|
|
49
|
+
event: NoiseSensorNoiseThresholdTriggeredEvent
|
|
50
|
+
): string | null => {
|
|
51
|
+
if (event.noise_threshold_name != null) {
|
|
47
52
|
return event.noise_threshold_name
|
|
48
53
|
}
|
|
49
54
|
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
-
return `${event.noise_level_decibels as string} ${t.decibel}`
|
|
55
|
+
if (event.noise_level_decibels != null) {
|
|
56
|
+
return `${event.noise_level_decibels} ${t.decibel}`
|
|
53
57
|
}
|
|
54
58
|
|
|
55
59
|
return null
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { NoiseThreshold } from '@seamapi/types/connect'
|
|
2
2
|
import { ZonedTime } from 'zoned-time'
|
|
3
3
|
|
|
4
4
|
import { formatTime, formatTimeZone } from 'lib/dates.js'
|
|
5
5
|
import { ArrowRightIcon } from 'lib/icons/ArrowRight.js'
|
|
6
|
+
import type { NoiseSensorDevice } from 'lib/seam/noise-sensors/noise-sensor-device.js'
|
|
6
7
|
import { useNoiseThresholds } from 'lib/seam/noise-sensors/use-noise-thresholds.js'
|
|
7
8
|
import { DetailRow } from 'lib/ui/layout/DetailRow.js'
|
|
8
9
|
import { DetailSection } from 'lib/ui/layout/DetailSection.js'
|
|
@@ -67,7 +68,7 @@ export function NoiseThresholdsList({
|
|
|
67
68
|
function Content({
|
|
68
69
|
noiseThresholds,
|
|
69
70
|
}: {
|
|
70
|
-
noiseThresholds:
|
|
71
|
+
noiseThresholds: NoiseThreshold[] | undefined
|
|
71
72
|
}): JSX.Element | JSX.Element[] {
|
|
72
73
|
if (noiseThresholds == null || noiseThresholds.length === 0) {
|
|
73
74
|
return (
|
|
@@ -106,7 +107,7 @@ function Content({
|
|
|
106
107
|
|
|
107
108
|
const getTimeZoneCaption = (
|
|
108
109
|
device: NoiseSensorDevice,
|
|
109
|
-
thresholds:
|
|
110
|
+
thresholds: NoiseThreshold[] | undefined
|
|
110
111
|
): string | null => {
|
|
111
112
|
if (device.location?.timezone != null) {
|
|
112
113
|
return `${t.allTimesIn} ${formatTimeZone(device.location.timezone)}`
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type { HvacModeSetting } from 'seamapi'
|
|
2
|
-
|
|
3
1
|
import { ChevronDownIcon } from 'lib/icons/ChevronDown.js'
|
|
4
2
|
import { OffIcon } from 'lib/icons/Off.js'
|
|
5
3
|
import { ThermostatCoolIcon } from 'lib/icons/ThermostatCool.js'
|
|
6
4
|
import { ThermostatHeatIcon } from 'lib/icons/ThermostatHeat.js'
|
|
7
5
|
import { ThermostatHeatCoolIcon } from 'lib/icons/ThermostatHeatCool.js'
|
|
6
|
+
import type { HvacModeSetting } from 'lib/seam/thermostats/thermostat-device.js'
|
|
8
7
|
import { Menu } from 'lib/ui/Menu/Menu.js'
|
|
9
8
|
import { ThermoModeMenuOption } from 'lib/ui/thermostat/ThermoModeMenuOption.js'
|
|
10
9
|
|