@@ -7,70 +7,40 @@ import {
7
7
hvac_mode_setting ,
8
8
} from '../../thermostats/index.js'
9
9
10
- const base_thermostat_capability_properties = z . object ( {
11
- temperature_fahrenheit : z . number ( ) ,
12
- temperature_celsius : z . number ( ) ,
13
- relative_humidity : z . number ( ) . min ( 0 ) . max ( 1 ) ,
14
- can_enable_automatic_heating : z . boolean ( ) ,
15
- can_enable_automatic_cooling : z . boolean ( ) ,
16
- available_hvac_mode_settings : z . array ( hvac_mode_setting ) ,
17
- is_heating_available : z . literal ( false ) ,
18
- is_cooling_available : z . literal ( false ) ,
19
- is_heating : z . boolean ( ) ,
20
- is_cooling : z . boolean ( ) ,
21
- is_fan_running : z . boolean ( ) ,
22
- fan_mode_setting,
23
-
24
- /**
25
- * this is true if the current thermostat settings differ that what is on seam, and `current_climate_setting.manual_override_allowed: true`
26
- */
27
- is_temporary_manual_override_active : z . boolean ( ) ,
28
-
29
- /**
30
- * can be derived from `default_climate_setting`, or `active_climate_setting_schedule` if one is active
31
- */
32
- current_climate_setting : climate_setting ,
33
- default_climate_setting : climate_setting . optional ( ) ,
34
- is_climate_setting_schedule_active : z . boolean ( ) ,
35
- active_climate_setting_schedule : climate_setting_schedule . optional ( ) ,
36
- } )
37
-
38
- export const cooling_thermostat_capability_properties =
39
- base_thermostat_capability_properties . merge (
40
- z . object ( {
41
- min_cooling_set_point_celsius : z . number ( ) ,
42
- min_cooling_set_point_fahrenheit : z . number ( ) ,
43
- max_cooling_set_point_celsius : z . number ( ) ,
44
- max_cooling_set_point_fahrenheit : z . number ( ) ,
45
- is_cooling_available : z . literal ( true ) ,
46
- } ) ,
47
- )
48
-
49
- export const heating_thermostat_capability_properties =
50
- base_thermostat_capability_properties . merge (
51
- z . object ( {
52
- min_heating_set_point_celsius : z . number ( ) ,
53
- min_heating_set_point_fahrenheit : z . number ( ) ,
54
- max_heating_set_point_celsius : z . number ( ) ,
55
- max_heating_set_point_fahrenheit : z . number ( ) ,
56
- is_heating_available : z . literal ( true ) ,
57
- } ) ,
58
- )
59
-
60
- export const heating_cooling_thermostat_capability_properties =
61
- cooling_thermostat_capability_properties
62
- . merge ( heating_thermostat_capability_properties )
63
- . merge (
64
- z . object ( {
65
- is_cooling_available : z . literal ( true ) ,
66
- is_heating_available : z . literal ( true ) ,
67
- min_heating_cooling_delta_celsius : z . number ( ) ,
68
- min_heating_cooling_delta_fahrenheit : z . number ( ) ,
69
- } ) ,
70
- )
71
-
72
- export const thermostat_capability_properties = z . union ( [
73
- heating_cooling_thermostat_capability_properties . partial ( ) ,
74
- heating_thermostat_capability_properties . partial ( ) ,
75
- cooling_thermostat_capability_properties . partial ( ) ,
76
- ] )
10
+ export const thermostat_capability_properties = z
11
+ . object ( {
12
+ temperature_fahrenheit : z . number ( ) ,
13
+ temperature_celsius : z . number ( ) ,
14
+ relative_humidity : z . number ( ) . min ( 0 ) . max ( 1 ) ,
15
+ can_enable_automatic_heating : z . boolean ( ) ,
16
+ can_enable_automatic_cooling : z . boolean ( ) ,
17
+ available_hvac_mode_settings : z . array ( hvac_mode_setting ) ,
18
+ is_heating : z . boolean ( ) ,
19
+ is_cooling : z . boolean ( ) ,
20
+ is_fan_running : z . boolean ( ) ,
21
+ fan_mode_setting,
22
+
23
+ /**
24
+ * this is true if the current thermostat settings differ that what is on seam, and `current_climate_setting.manual_override_allowed: true`
25
+ */
26
+ is_temporary_manual_override_active : z . boolean ( ) ,
27
+
28
+ /**
29
+ * can be derived from `default_climate_setting`, or `active_climate_setting_schedule` if one is active
30
+ */
31
+ current_climate_setting : climate_setting ,
32
+ default_climate_setting : climate_setting ,
33
+ is_climate_setting_schedule_active : z . boolean ( ) ,
34
+ active_climate_setting_schedule : climate_setting_schedule ,
35
+ min_cooling_set_point_celsius : z . number ( ) ,
36
+ min_cooling_set_point_fahrenheit : z . number ( ) ,
37
+ max_cooling_set_point_celsius : z . number ( ) ,
38
+ max_cooling_set_point_fahrenheit : z . number ( ) ,
39
+ min_heating_set_point_celsius : z . number ( ) ,
40
+ min_heating_set_point_fahrenheit : z . number ( ) ,
41
+ max_heating_set_point_celsius : z . number ( ) ,
42
+ max_heating_set_point_fahrenheit : z . number ( ) ,
43
+ min_heating_cooling_delta_celsius : z . number ( ) ,
44
+ min_heating_cooling_delta_fahrenheit : z . number ( ) ,
45
+ } )
46
+ . partial ( )
0 commit comments