@seamapi/react 2.0.2 → 2.1.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 +3 -3
- package/dist/elements.js +2917 -2829
- package/dist/elements.js.map +1 -1
- package/dist/index.css +60 -0
- package/dist/index.css.map +1 -1
- package/dist/index.min.css +1 -1
- package/dist/index.min.css.map +1 -1
- package/lib/seam/access-codes/use-access-codes.js +11 -1
- package/lib/seam/access-codes/use-access-codes.js.map +1 -1
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.d.ts +6 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.js +21 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/use-device-models.js +12 -1
- package/lib/seam/components/SupportedDeviceTable/use-device-models.js.map +1 -1
- package/lib/seam/components/SupportedDeviceTable/use-manufacturers.js +12 -1
- package/lib/seam/components/SupportedDeviceTable/use-manufacturers.js.map +1 -1
- package/lib/seam/components/index.d.ts +1 -0
- package/lib/seam/components/index.js +1 -0
- package/lib/seam/components/index.js.map +1 -1
- package/lib/seam/devices/use-devices.js +0 -1
- package/lib/seam/devices/use-devices.js.map +1 -1
- package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.js +0 -1
- package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.js.map +1 -1
- package/lib/seam/thermostats/use-update-fan-mode.d.ts +6 -0
- package/lib/seam/thermostats/use-update-fan-mode.js +42 -0
- package/lib/seam/thermostats/use-update-fan-mode.js.map +1 -0
- package/lib/seam/thermostats/use-update-thermostat.d.ts +6 -0
- package/lib/seam/thermostats/use-update-thermostat.js +50 -0
- package/lib/seam/thermostats/use-update-thermostat.js.map +1 -0
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.d.ts +6 -1
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.js +39 -6
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.js.map +1 -1
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormClimateSetting.d.ts +13 -0
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormClimateSetting.js +37 -0
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormClimateSetting.js.map +1 -0
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDefaultClimateSetting.d.ts +10 -0
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDefaultClimateSetting.js +24 -0
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDefaultClimateSetting.js.map +1 -0
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDeviceSelect.d.ts +1 -2
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDeviceSelect.js +1 -2
- package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDeviceSelect.js.map +1 -1
- package/lib/ui/thermostat/ClimateSettingControlGroup.d.ts +9 -0
- package/lib/ui/thermostat/ClimateSettingControlGroup.js +8 -0
- package/lib/ui/thermostat/ClimateSettingControlGroup.js.map +1 -0
- package/lib/ui/thermostat/TemperatureControlGroup.d.ts +6 -7
- package/lib/ui/thermostat/TemperatureControlGroup.js +1 -1
- package/lib/ui/thermostat/TemperatureControlGroup.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +2 -2
- package/src/lib/seam/access-codes/use-access-codes.ts +15 -1
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.element.ts +9 -0
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.tsx +65 -0
- package/src/lib/seam/components/SupportedDeviceTable/use-device-models.ts +15 -1
- package/src/lib/seam/components/SupportedDeviceTable/use-manufacturers.ts +15 -1
- package/src/lib/seam/components/elements.ts +1 -0
- package/src/lib/seam/components/index.ts +1 -0
- package/src/lib/seam/devices/use-devices.ts +0 -1
- package/src/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.ts +0 -1
- package/src/lib/seam/thermostats/use-update-fan-mode.ts +81 -0
- package/src/lib/seam/thermostats/use-update-thermostat.ts +92 -0
- package/src/lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.tsx +77 -15
- package/src/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormClimateSetting.tsx +103 -0
- package/src/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDefaultClimateSetting.tsx +79 -0
- package/src/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDeviceSelect.tsx +0 -3
- package/src/lib/ui/thermostat/ClimateSettingControlGroup.tsx +32 -0
- package/src/lib/ui/thermostat/TemperatureControlGroup.tsx +11 -11
- package/src/lib/version.ts +1 -1
- package/src/styles/_climate-setting-schedule-form.scss +54 -0
- package/src/styles/_main.scss +2 -0
- package/src/styles/_supported-device-table-manufacturer-keys.scss +19 -0
- package/src/styles/_thermostat.scss +15 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { useState } from 'react'
|
|
2
|
+
import type { HvacModeSetting } from 'seamapi'
|
|
3
|
+
|
|
4
|
+
import { useDevice } from 'lib/seam/devices/use-device.js'
|
|
5
|
+
import { Button } from 'lib/ui/Button.js'
|
|
6
|
+
import { InputLabel } from 'lib/ui/InputLabel.js'
|
|
7
|
+
import { ContentHeader } from 'lib/ui/layout/ContentHeader.js'
|
|
8
|
+
import { ClimateSettingControlGroup } from 'lib/ui/thermostat/ClimateSettingControlGroup.js'
|
|
9
|
+
|
|
10
|
+
interface ClimateSettingScheduleFormDefaultClimateSettingProps {
|
|
11
|
+
title: string
|
|
12
|
+
deviceId: string
|
|
13
|
+
onBack: () => void
|
|
14
|
+
onCancel: (() => void) | undefined
|
|
15
|
+
onSave: () => void
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function ClimateSettingScheduleFormDefaultClimateSetting({
|
|
19
|
+
title,
|
|
20
|
+
deviceId,
|
|
21
|
+
onBack,
|
|
22
|
+
onCancel,
|
|
23
|
+
onSave,
|
|
24
|
+
}: ClimateSettingScheduleFormDefaultClimateSettingProps): JSX.Element {
|
|
25
|
+
const { device } = useDevice({
|
|
26
|
+
device_id: deviceId,
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
const [mode, setMode] = useState<HvacModeSetting>('heat_cool')
|
|
30
|
+
const [heatValue, setHeatValue] = useState(70)
|
|
31
|
+
const [coolValue, setCoolValue] = useState(75)
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<>
|
|
35
|
+
<ContentHeader
|
|
36
|
+
title={title}
|
|
37
|
+
onBack={onBack}
|
|
38
|
+
subheading={device?.properties.name}
|
|
39
|
+
/>
|
|
40
|
+
<div className='seam-main'>
|
|
41
|
+
<div className='seam-climate-setting-schedule-form-default-climate-setting'>
|
|
42
|
+
<div className='seam-content'>
|
|
43
|
+
<div className='seam-default-climate-setting-message'>
|
|
44
|
+
<p>{t.defaultClimateMessage}</p>
|
|
45
|
+
</div>
|
|
46
|
+
<div className='seam-control-group-title'>
|
|
47
|
+
<InputLabel>{t.defaultClimate}</InputLabel>
|
|
48
|
+
<span className='seam-label'>{t.defautClimateSubHeading}</span>
|
|
49
|
+
</div>
|
|
50
|
+
<ClimateSettingControlGroup
|
|
51
|
+
mode={mode}
|
|
52
|
+
onModeChange={setMode}
|
|
53
|
+
heatValue={heatValue}
|
|
54
|
+
onHeatValueChange={setHeatValue}
|
|
55
|
+
coolValue={coolValue}
|
|
56
|
+
onCoolValueChange={setCoolValue}
|
|
57
|
+
/>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
<div className='seam-actions'>
|
|
61
|
+
<Button onClick={onCancel}>{t.cancel}</Button>
|
|
62
|
+
<Button variant='solid' onClick={onSave}>
|
|
63
|
+
{t.save}
|
|
64
|
+
</Button>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const t = {
|
|
72
|
+
defaultClimate: 'Default Climate',
|
|
73
|
+
defautClimateSubHeading:
|
|
74
|
+
'Choose the default mode and climate for this device',
|
|
75
|
+
defaultClimateMessage:
|
|
76
|
+
'This device doesn’t have a default climate set up yet. Choose the climate you’d like the device to fall back to after scheduled climates reach their ends.',
|
|
77
|
+
cancel: 'Cancel',
|
|
78
|
+
save: 'Save',
|
|
79
|
+
}
|
|
@@ -7,7 +7,6 @@ import { ThermostatSelect } from 'lib/ui/thermostat/ThermostatSelect.js'
|
|
|
7
7
|
interface ClimateSettingScheduleFormDeviceSelectProps {
|
|
8
8
|
title: string
|
|
9
9
|
control: Control<ClimateSettingScheduleFormFields>
|
|
10
|
-
onSelect: () => void
|
|
11
10
|
onBack: (() => void) | undefined
|
|
12
11
|
}
|
|
13
12
|
|
|
@@ -15,7 +14,6 @@ export function ClimateSettingScheduleFormDeviceSelect({
|
|
|
15
14
|
title,
|
|
16
15
|
control,
|
|
17
16
|
onBack,
|
|
18
|
-
onSelect,
|
|
19
17
|
}: ClimateSettingScheduleFormDeviceSelectProps): JSX.Element {
|
|
20
18
|
return (
|
|
21
19
|
<>
|
|
@@ -28,7 +26,6 @@ export function ClimateSettingScheduleFormDeviceSelect({
|
|
|
28
26
|
<ThermostatSelect
|
|
29
27
|
onSelect={(deviceId) => {
|
|
30
28
|
onChange(deviceId)
|
|
31
|
-
onSelect()
|
|
32
29
|
}}
|
|
33
30
|
/>
|
|
34
31
|
)}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { HvacModeSetting } from 'seamapi'
|
|
2
|
+
|
|
3
|
+
import { ClimateModeMenu } from 'lib/ui/thermostat/ClimateModeMenu.js'
|
|
4
|
+
import {
|
|
5
|
+
TemperatureControlGroup,
|
|
6
|
+
type TemperatureControlGroupProps,
|
|
7
|
+
} from 'lib/ui/thermostat/TemperatureControlGroup.js'
|
|
8
|
+
|
|
9
|
+
type ClimateSettingControlGroupProps = Omit<
|
|
10
|
+
TemperatureControlGroupProps,
|
|
11
|
+
'mode'
|
|
12
|
+
> & {
|
|
13
|
+
mode: HvacModeSetting
|
|
14
|
+
onModeChange: (mode: HvacModeSetting) => void
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function ClimateSettingControlGroup(
|
|
18
|
+
props: ClimateSettingControlGroupProps
|
|
19
|
+
): JSX.Element {
|
|
20
|
+
const { mode, onModeChange, ...rest } = props
|
|
21
|
+
return (
|
|
22
|
+
<div className='seam-climate-setting-control-group'>
|
|
23
|
+
<ClimateModeMenu mode={mode} onChange={onModeChange} />
|
|
24
|
+
|
|
25
|
+
{mode !== 'off' && (
|
|
26
|
+
<div className='seam-climate-setting-slider-container'>
|
|
27
|
+
<TemperatureControlGroup mode={mode} {...rest} />
|
|
28
|
+
</div>
|
|
29
|
+
)}
|
|
30
|
+
</div>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
@@ -10,17 +10,17 @@ import {
|
|
|
10
10
|
} from 'lib/temperature-bounds.js'
|
|
11
11
|
import { TemperatureControl } from 'lib/ui/thermostat/TemperatureControl.js'
|
|
12
12
|
|
|
13
|
-
interface TemperatureControlGroupProps {
|
|
13
|
+
export interface TemperatureControlGroupProps {
|
|
14
14
|
mode: Exclude<HvacModeSetting, 'off'>
|
|
15
15
|
heatValue: number
|
|
16
16
|
onHeatValueChange: (temperature: number) => void
|
|
17
17
|
coolValue: number
|
|
18
18
|
onCoolValueChange: (temperature: number) => void
|
|
19
|
-
delta
|
|
20
|
-
minHeat
|
|
21
|
-
maxHeat
|
|
22
|
-
minCool
|
|
23
|
-
maxCool
|
|
19
|
+
delta?: number
|
|
20
|
+
minHeat?: number
|
|
21
|
+
maxHeat?: number
|
|
22
|
+
minCool?: number
|
|
23
|
+
maxCool?: number
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export function TemperatureControlGroup({
|
|
@@ -29,11 +29,11 @@ export function TemperatureControlGroup({
|
|
|
29
29
|
onHeatValueChange,
|
|
30
30
|
coolValue,
|
|
31
31
|
onCoolValueChange,
|
|
32
|
-
delta,
|
|
33
|
-
minHeat,
|
|
34
|
-
maxHeat,
|
|
35
|
-
minCool,
|
|
36
|
-
maxCool,
|
|
32
|
+
delta = 5,
|
|
33
|
+
minHeat = 60,
|
|
34
|
+
maxHeat = 90,
|
|
35
|
+
minCool = 60,
|
|
36
|
+
maxCool = 90,
|
|
37
37
|
}: TemperatureControlGroupProps): JSX.Element {
|
|
38
38
|
const showHeat = mode === 'heat' || mode === 'heat_cool'
|
|
39
39
|
const showCool = mode === 'cool' || mode === 'heat_cool'
|
package/src/lib/version.ts
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
.seam-climate-setting-schedule-form {
|
|
5
5
|
@include main;
|
|
6
6
|
@include name-and-schedule;
|
|
7
|
+
@include default-climate-setting;
|
|
8
|
+
@include climate-setting;
|
|
7
9
|
}
|
|
8
10
|
}
|
|
9
11
|
|
|
@@ -55,3 +57,55 @@
|
|
|
55
57
|
}
|
|
56
58
|
}
|
|
57
59
|
}
|
|
60
|
+
|
|
61
|
+
@mixin default-climate-setting {
|
|
62
|
+
.seam-climate-setting-schedule-form-default-climate-setting {
|
|
63
|
+
.seam-control-group-title {
|
|
64
|
+
margin-top: 16px;
|
|
65
|
+
margin-bottom: 16px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.seam-label {
|
|
69
|
+
color: colors.$text-gray-1;
|
|
70
|
+
font-size: 14px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.seam-default-climate-setting-message {
|
|
74
|
+
> p {
|
|
75
|
+
color: colors.$text-gray-1;
|
|
76
|
+
font-size: 14px;
|
|
77
|
+
margin-bottom: 16px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
margin-top: 4px;
|
|
81
|
+
border-bottom: 1px solid colors.$divider-stroke-light;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.seam-climate-setting-control-group {
|
|
85
|
+
margin-bottom: 32px;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@mixin climate-setting {
|
|
91
|
+
.seam-climate-setting-schedule-form-climate-setting {
|
|
92
|
+
.seam-content {
|
|
93
|
+
display: flex;
|
|
94
|
+
flex-direction: column;
|
|
95
|
+
gap: 16px;
|
|
96
|
+
width: 100%;
|
|
97
|
+
margin-top: 24px;
|
|
98
|
+
margin-bottom: 24px;
|
|
99
|
+
|
|
100
|
+
.seam-label {
|
|
101
|
+
color: colors.$text-gray-2;
|
|
102
|
+
font-size: 14px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.seam-climate-setting-slider-container {
|
|
106
|
+
display: flex;
|
|
107
|
+
justify-content: center;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
package/src/styles/_main.scss
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
@use './device-table';
|
|
14
14
|
@use './access-code-details';
|
|
15
15
|
@use './supported-device-table';
|
|
16
|
+
@use './supported-device-table-manufacturer-keys';
|
|
16
17
|
@use './access-code-form';
|
|
17
18
|
@use './input-label';
|
|
18
19
|
@use './form-field';
|
|
@@ -59,6 +60,7 @@
|
|
|
59
60
|
@include climate-setting-schedule-form.all;
|
|
60
61
|
@include alert.all;
|
|
61
62
|
@include supported-device-table.all;
|
|
63
|
+
@include supported-device-table-manufacturer-keys.all;
|
|
62
64
|
@include thermostat.all;
|
|
63
65
|
@include seam-table.all;
|
|
64
66
|
@include climate-setting-schedule-details.all;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@mixin all {
|
|
2
|
+
.supported-device-table-manufacturer-keys {
|
|
3
|
+
font-size: 18px;
|
|
4
|
+
|
|
5
|
+
.seam-manufacturer-key {
|
|
6
|
+
display: table-row;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.seam-manufacturer-key-value {
|
|
10
|
+
display: table-cell;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.seam-copy-button {
|
|
14
|
+
display: table-cell;
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
padding-left: 10px;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
@use './colors';
|
|
2
2
|
|
|
3
|
+
@mixin climate-setting-control-group {
|
|
4
|
+
.seam-climate-setting-control-group {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
gap: 16px;
|
|
8
|
+
width: 100%;
|
|
9
|
+
|
|
10
|
+
.seam-climate-setting-slider-container {
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
3
17
|
@mixin temperature-control-group {
|
|
4
18
|
.seam-temperature-control-group {
|
|
5
19
|
display: flex;
|
|
@@ -690,6 +704,7 @@
|
|
|
690
704
|
}
|
|
691
705
|
|
|
692
706
|
@mixin all {
|
|
707
|
+
@include climate-setting-control-group;
|
|
693
708
|
@include temperature-control-group;
|
|
694
709
|
@include temperature-control;
|
|
695
710
|
@include climate-setting-status;
|