Skip to content

Commit 2df135f

Browse files
authored
docs: Add missing properties to seed (#683)
* Check for available_climate_presets to detect ThermostatDevice * Add missing properties to seed
1 parent dec0e92 commit 2df135f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.storybook/seed-fake.js

+3
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ export const seedFake = (db) => {
396396
heating_set_point_celsius: 18.3,
397397
},
398398
available_hvac_mode_settings: ['off', 'cool', 'heat', 'heat_cool'],
399+
available_fan_mode_settings: ['auto', 'on', 'circulate'],
399400
can_enable_automatic_cooling: true,
400401
can_enable_automatic_heating: true,
401402
min_heating_cooling_delta_fahrenheit: 5,
@@ -474,6 +475,8 @@ export const seedFake = (db) => {
474475
heating_set_point_fahrenheit: 68,
475476
},
476477
available_hvac_mode_settings: ['off', 'cool', 'heat', 'heat_cool'],
478+
available_fan_mode_settings: ['auto', 'on'],
479+
available_climate_presets: [],
477480
can_enable_automatic_cooling: true,
478481
can_enable_automatic_heating: true,
479482
max_cooling_set_point_celsius: 33.333333333333336,

src/lib/seam/thermostats/thermostat-device.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ export interface ClimateSetting {
3636

3737
export const isThermostatDevice = (
3838
device: Device
39-
): device is ThermostatDevice => 'is_fan_running' in device.properties
39+
): device is ThermostatDevice =>
40+
'available_climate_presets' in device.properties
4041

4142
export type ThermostatClimatePreset =
4243
ThermostatDevice['properties']['available_climate_presets'][number]

0 commit comments

Comments
 (0)