Skip to content

Entities

EntityT = typing.TypeVar('EntityT', bound='BaseEntity', covariant=True) module-attribute

Represents a specific entity type, e.g., LightEntity, SensorEntity, etc.

AlarmControlPanelEntity

Bases: BaseEntity[AlarmControlPanelState, str]

Source code in src/hassette/models/entities/alarm_control_panel.py
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
class AlarmControlPanelEntity(BaseEntity[AlarmControlPanelState, str]):
    @property
    def attributes(self) -> AlarmControlPanelAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "AlarmControlPanelEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(AlarmControlPanelEntitySyncFacade)

    def alarm_disarm(
        self,
        *,
        code: str | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Disarms an alarm.

        Args:
            code: Code to disarm the alarm.
        """
        return self.api.call_service(
            domain=self.domain,
            service="alarm_disarm",
            target={"entity_id": self.entity_id},
            code=code,
        )

    def alarm_arm_custom_bypass(
        self,
        *,
        code: str | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Arms an alarm while allowing to bypass a custom area.

        Args:
            code: Code to arm the alarm.
        """
        return self.api.call_service(
            domain=self.domain,
            service="alarm_arm_custom_bypass",
            target={"entity_id": self.entity_id},
            code=code,
        )

    def alarm_arm_home(
        self,
        *,
        code: str | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Arms an alarm in the home mode.

        Args:
            code: Code to arm the alarm.
        """
        return self.api.call_service(
            domain=self.domain,
            service="alarm_arm_home",
            target={"entity_id": self.entity_id},
            code=code,
        )

    def alarm_arm_away(
        self,
        *,
        code: str | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Arms an alarm in the away mode.

        Args:
            code: Code to arm the alarm.
        """
        return self.api.call_service(
            domain=self.domain,
            service="alarm_arm_away",
            target={"entity_id": self.entity_id},
            code=code,
        )

    def alarm_arm_night(
        self,
        *,
        code: str | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Arms an alarm in the night mode.

        Args:
            code: Code to arm the alarm.
        """
        return self.api.call_service(
            domain=self.domain,
            service="alarm_arm_night",
            target={"entity_id": self.entity_id},
            code=code,
        )

    def alarm_arm_vacation(
        self,
        *,
        code: str | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Arms an alarm in the vacation mode.

        Args:
            code: Code to arm the alarm.
        """
        return self.api.call_service(
            domain=self.domain,
            service="alarm_arm_vacation",
            target={"entity_id": self.entity_id},
            code=code,
        )

    def alarm_trigger(
        self,
        *,
        code: str | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Triggers an alarm manually.

        Args:
            code: Code to arm the alarm.
        """
        return self.api.call_service(
            domain=self.domain,
            service="alarm_trigger",
            target={"entity_id": self.entity_id},
            code=code,
        )

sync: AlarmControlPanelEntitySyncFacade property

Return the typed synchronous facade for this entity.

alarm_disarm(*, code: str | None = None) -> Coroutine[Any, Any, None]

Disarms an alarm.

Parameters:

Name Type Description Default
code str | None

Code to disarm the alarm.

None
Source code in src/hassette/models/entities/alarm_control_panel.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
def alarm_disarm(
    self,
    *,
    code: str | None = None,
) -> Coroutine[Any, Any, None]:
    """Disarms an alarm.

    Args:
        code: Code to disarm the alarm.
    """
    return self.api.call_service(
        domain=self.domain,
        service="alarm_disarm",
        target={"entity_id": self.entity_id},
        code=code,
    )

alarm_arm_custom_bypass(*, code: str | None = None) -> Coroutine[Any, Any, None]

Arms an alarm while allowing to bypass a custom area.

Parameters:

Name Type Description Default
code str | None

Code to arm the alarm.

None
Source code in src/hassette/models/entities/alarm_control_panel.py
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
def alarm_arm_custom_bypass(
    self,
    *,
    code: str | None = None,
) -> Coroutine[Any, Any, None]:
    """Arms an alarm while allowing to bypass a custom area.

    Args:
        code: Code to arm the alarm.
    """
    return self.api.call_service(
        domain=self.domain,
        service="alarm_arm_custom_bypass",
        target={"entity_id": self.entity_id},
        code=code,
    )

alarm_arm_home(*, code: str | None = None) -> Coroutine[Any, Any, None]

Arms an alarm in the home mode.

Parameters:

Name Type Description Default
code str | None

Code to arm the alarm.

None
Source code in src/hassette/models/entities/alarm_control_panel.py
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
def alarm_arm_home(
    self,
    *,
    code: str | None = None,
) -> Coroutine[Any, Any, None]:
    """Arms an alarm in the home mode.

    Args:
        code: Code to arm the alarm.
    """
    return self.api.call_service(
        domain=self.domain,
        service="alarm_arm_home",
        target={"entity_id": self.entity_id},
        code=code,
    )

alarm_arm_away(*, code: str | None = None) -> Coroutine[Any, Any, None]

Arms an alarm in the away mode.

Parameters:

Name Type Description Default
code str | None

Code to arm the alarm.

None
Source code in src/hassette/models/entities/alarm_control_panel.py
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
def alarm_arm_away(
    self,
    *,
    code: str | None = None,
) -> Coroutine[Any, Any, None]:
    """Arms an alarm in the away mode.

    Args:
        code: Code to arm the alarm.
    """
    return self.api.call_service(
        domain=self.domain,
        service="alarm_arm_away",
        target={"entity_id": self.entity_id},
        code=code,
    )

alarm_arm_night(*, code: str | None = None) -> Coroutine[Any, Any, None]

Arms an alarm in the night mode.

Parameters:

Name Type Description Default
code str | None

Code to arm the alarm.

None
Source code in src/hassette/models/entities/alarm_control_panel.py
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
def alarm_arm_night(
    self,
    *,
    code: str | None = None,
) -> Coroutine[Any, Any, None]:
    """Arms an alarm in the night mode.

    Args:
        code: Code to arm the alarm.
    """
    return self.api.call_service(
        domain=self.domain,
        service="alarm_arm_night",
        target={"entity_id": self.entity_id},
        code=code,
    )

alarm_arm_vacation(*, code: str | None = None) -> Coroutine[Any, Any, None]

Arms an alarm in the vacation mode.

Parameters:

Name Type Description Default
code str | None

Code to arm the alarm.

None
Source code in src/hassette/models/entities/alarm_control_panel.py
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
def alarm_arm_vacation(
    self,
    *,
    code: str | None = None,
) -> Coroutine[Any, Any, None]:
    """Arms an alarm in the vacation mode.

    Args:
        code: Code to arm the alarm.
    """
    return self.api.call_service(
        domain=self.domain,
        service="alarm_arm_vacation",
        target={"entity_id": self.entity_id},
        code=code,
    )

alarm_trigger(*, code: str | None = None) -> Coroutine[Any, Any, None]

Triggers an alarm manually.

Parameters:

Name Type Description Default
code str | None

Code to arm the alarm.

None
Source code in src/hassette/models/entities/alarm_control_panel.py
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
def alarm_trigger(
    self,
    *,
    code: str | None = None,
) -> Coroutine[Any, Any, None]:
    """Triggers an alarm manually.

    Args:
        code: Code to arm the alarm.
    """
    return self.api.call_service(
        domain=self.domain,
        service="alarm_trigger",
        target={"entity_id": self.entity_id},
        code=code,
    )

AlarmControlPanelEntitySyncFacade

Bases: BaseEntitySyncFacade[AlarmControlPanelState, str]

Synchronous facade for AlarmControlPanelEntity service methods.

Source code in src/hassette/models/entities/alarm_control_panel.py
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
class AlarmControlPanelEntitySyncFacade(BaseEntitySyncFacade[AlarmControlPanelState, str]):
    """Synchronous facade for AlarmControlPanelEntity service methods."""

    def alarm_disarm(
        self,
        *,
        code: str | None = None,
    ) -> None:
        """Disarms an alarm.

        Args:
            code: Code to disarm the alarm.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="alarm_disarm",
            target={"entity_id": self.entity.entity_id},
            code=code,
        )

    def alarm_arm_custom_bypass(
        self,
        *,
        code: str | None = None,
    ) -> None:
        """Arms an alarm while allowing to bypass a custom area.

        Args:
            code: Code to arm the alarm.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="alarm_arm_custom_bypass",
            target={"entity_id": self.entity.entity_id},
            code=code,
        )

    def alarm_arm_home(
        self,
        *,
        code: str | None = None,
    ) -> None:
        """Arms an alarm in the home mode.

        Args:
            code: Code to arm the alarm.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="alarm_arm_home",
            target={"entity_id": self.entity.entity_id},
            code=code,
        )

    def alarm_arm_away(
        self,
        *,
        code: str | None = None,
    ) -> None:
        """Arms an alarm in the away mode.

        Args:
            code: Code to arm the alarm.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="alarm_arm_away",
            target={"entity_id": self.entity.entity_id},
            code=code,
        )

    def alarm_arm_night(
        self,
        *,
        code: str | None = None,
    ) -> None:
        """Arms an alarm in the night mode.

        Args:
            code: Code to arm the alarm.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="alarm_arm_night",
            target={"entity_id": self.entity.entity_id},
            code=code,
        )

    def alarm_arm_vacation(
        self,
        *,
        code: str | None = None,
    ) -> None:
        """Arms an alarm in the vacation mode.

        Args:
            code: Code to arm the alarm.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="alarm_arm_vacation",
            target={"entity_id": self.entity.entity_id},
            code=code,
        )

    def alarm_trigger(
        self,
        *,
        code: str | None = None,
    ) -> None:
        """Triggers an alarm manually.

        Args:
            code: Code to arm the alarm.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="alarm_trigger",
            target={"entity_id": self.entity.entity_id},
            code=code,
        )

alarm_disarm(*, code: str | None = None) -> None

Disarms an alarm.

Parameters:

Name Type Description Default
code str | None

Code to disarm the alarm.

None
Source code in src/hassette/models/entities/alarm_control_panel.py
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
def alarm_disarm(
    self,
    *,
    code: str | None = None,
) -> None:
    """Disarms an alarm.

    Args:
        code: Code to disarm the alarm.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="alarm_disarm",
        target={"entity_id": self.entity.entity_id},
        code=code,
    )

alarm_arm_custom_bypass(*, code: str | None = None) -> None

Arms an alarm while allowing to bypass a custom area.

Parameters:

Name Type Description Default
code str | None

Code to arm the alarm.

None
Source code in src/hassette/models/entities/alarm_control_panel.py
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
def alarm_arm_custom_bypass(
    self,
    *,
    code: str | None = None,
) -> None:
    """Arms an alarm while allowing to bypass a custom area.

    Args:
        code: Code to arm the alarm.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="alarm_arm_custom_bypass",
        target={"entity_id": self.entity.entity_id},
        code=code,
    )

alarm_arm_home(*, code: str | None = None) -> None

Arms an alarm in the home mode.

Parameters:

Name Type Description Default
code str | None

Code to arm the alarm.

None
Source code in src/hassette/models/entities/alarm_control_panel.py
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
def alarm_arm_home(
    self,
    *,
    code: str | None = None,
) -> None:
    """Arms an alarm in the home mode.

    Args:
        code: Code to arm the alarm.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="alarm_arm_home",
        target={"entity_id": self.entity.entity_id},
        code=code,
    )

alarm_arm_away(*, code: str | None = None) -> None

Arms an alarm in the away mode.

Parameters:

Name Type Description Default
code str | None

Code to arm the alarm.

None
Source code in src/hassette/models/entities/alarm_control_panel.py
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
def alarm_arm_away(
    self,
    *,
    code: str | None = None,
) -> None:
    """Arms an alarm in the away mode.

    Args:
        code: Code to arm the alarm.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="alarm_arm_away",
        target={"entity_id": self.entity.entity_id},
        code=code,
    )

alarm_arm_night(*, code: str | None = None) -> None

Arms an alarm in the night mode.

Parameters:

Name Type Description Default
code str | None

Code to arm the alarm.

None
Source code in src/hassette/models/entities/alarm_control_panel.py
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
def alarm_arm_night(
    self,
    *,
    code: str | None = None,
) -> None:
    """Arms an alarm in the night mode.

    Args:
        code: Code to arm the alarm.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="alarm_arm_night",
        target={"entity_id": self.entity.entity_id},
        code=code,
    )

alarm_arm_vacation(*, code: str | None = None) -> None

Arms an alarm in the vacation mode.

Parameters:

Name Type Description Default
code str | None

Code to arm the alarm.

None
Source code in src/hassette/models/entities/alarm_control_panel.py
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
def alarm_arm_vacation(
    self,
    *,
    code: str | None = None,
) -> None:
    """Arms an alarm in the vacation mode.

    Args:
        code: Code to arm the alarm.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="alarm_arm_vacation",
        target={"entity_id": self.entity.entity_id},
        code=code,
    )

alarm_trigger(*, code: str | None = None) -> None

Triggers an alarm manually.

Parameters:

Name Type Description Default
code str | None

Code to arm the alarm.

None
Source code in src/hassette/models/entities/alarm_control_panel.py
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
def alarm_trigger(
    self,
    *,
    code: str | None = None,
) -> None:
    """Triggers an alarm manually.

    Args:
        code: Code to arm the alarm.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="alarm_trigger",
        target={"entity_id": self.entity.entity_id},
        code=code,
    )

AutomationEntity

Bases: BaseEntity[AutomationState, str]

Source code in src/hassette/models/entities/automation.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
class AutomationEntity(BaseEntity[AutomationState, str]):
    @property
    def attributes(self) -> AutomationAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "AutomationEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(AutomationEntitySyncFacade)

    def turn_on(self) -> Coroutine[Any, Any, None]:
        """Enables an automation."""
        return self.api.call_service(
            domain=self.domain,
            service="turn_on",
            target={"entity_id": self.entity_id},
        )

    def turn_off(
        self,
        *,
        stop_actions: bool | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Disables an automation.

        Args:
            stop_actions: Stops currently running actions.
        """
        return self.api.call_service(
            domain=self.domain,
            service="turn_off",
            target={"entity_id": self.entity_id},
            stop_actions=stop_actions,
        )

    def toggle(self) -> Coroutine[Any, Any, None]:
        """Toggles (enable / disable) an automation."""
        return self.api.call_service(
            domain=self.domain,
            service="toggle",
            target={"entity_id": self.entity_id},
        )

    def trigger(
        self,
        *,
        skip_condition: bool | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Triggers the actions of an automation.

        Args:
            skip_condition: Defines whether or not the conditions will be skipped.
        """
        return self.api.call_service(
            domain=self.domain,
            service="trigger",
            target={"entity_id": self.entity_id},
            skip_condition=skip_condition,
        )

sync: AutomationEntitySyncFacade property

Return the typed synchronous facade for this entity.

turn_on() -> Coroutine[Any, Any, None]

Enables an automation.

Source code in src/hassette/models/entities/automation.py
20
21
22
23
24
25
26
def turn_on(self) -> Coroutine[Any, Any, None]:
    """Enables an automation."""
    return self.api.call_service(
        domain=self.domain,
        service="turn_on",
        target={"entity_id": self.entity_id},
    )

turn_off(*, stop_actions: bool | None = None) -> Coroutine[Any, Any, None]

Disables an automation.

Parameters:

Name Type Description Default
stop_actions bool | None

Stops currently running actions.

None
Source code in src/hassette/models/entities/automation.py
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
def turn_off(
    self,
    *,
    stop_actions: bool | None = None,
) -> Coroutine[Any, Any, None]:
    """Disables an automation.

    Args:
        stop_actions: Stops currently running actions.
    """
    return self.api.call_service(
        domain=self.domain,
        service="turn_off",
        target={"entity_id": self.entity_id},
        stop_actions=stop_actions,
    )

toggle() -> Coroutine[Any, Any, None]

Toggles (enable / disable) an automation.

Source code in src/hassette/models/entities/automation.py
45
46
47
48
49
50
51
def toggle(self) -> Coroutine[Any, Any, None]:
    """Toggles (enable / disable) an automation."""
    return self.api.call_service(
        domain=self.domain,
        service="toggle",
        target={"entity_id": self.entity_id},
    )

trigger(*, skip_condition: bool | None = None) -> Coroutine[Any, Any, None]

Triggers the actions of an automation.

Parameters:

Name Type Description Default
skip_condition bool | None

Defines whether or not the conditions will be skipped.

None
Source code in src/hassette/models/entities/automation.py
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
def trigger(
    self,
    *,
    skip_condition: bool | None = None,
) -> Coroutine[Any, Any, None]:
    """Triggers the actions of an automation.

    Args:
        skip_condition: Defines whether or not the conditions will be skipped.
    """
    return self.api.call_service(
        domain=self.domain,
        service="trigger",
        target={"entity_id": self.entity_id},
        skip_condition=skip_condition,
    )

AutomationEntitySyncFacade

Bases: BaseEntitySyncFacade[AutomationState, str]

Synchronous facade for AutomationEntity service methods.

Source code in src/hassette/models/entities/automation.py
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
class AutomationEntitySyncFacade(BaseEntitySyncFacade[AutomationState, str]):
    """Synchronous facade for AutomationEntity service methods."""

    def turn_on(self) -> None:
        """Enables an automation."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="turn_on",
            target={"entity_id": self.entity.entity_id},
        )

    def turn_off(
        self,
        *,
        stop_actions: bool | None = None,
    ) -> None:
        """Disables an automation.

        Args:
            stop_actions: Stops currently running actions.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="turn_off",
            target={"entity_id": self.entity.entity_id},
            stop_actions=stop_actions,
        )

    def toggle(self) -> None:
        """Toggles (enable / disable) an automation."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="toggle",
            target={"entity_id": self.entity.entity_id},
        )

    def trigger(
        self,
        *,
        skip_condition: bool | None = None,
    ) -> None:
        """Triggers the actions of an automation.

        Args:
            skip_condition: Defines whether or not the conditions will be skipped.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="trigger",
            target={"entity_id": self.entity.entity_id},
            skip_condition=skip_condition,
        )

turn_on() -> None

Enables an automation.

Source code in src/hassette/models/entities/automation.py
74
75
76
77
78
79
80
def turn_on(self) -> None:
    """Enables an automation."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="turn_on",
        target={"entity_id": self.entity.entity_id},
    )

turn_off(*, stop_actions: bool | None = None) -> None

Disables an automation.

Parameters:

Name Type Description Default
stop_actions bool | None

Stops currently running actions.

None
Source code in src/hassette/models/entities/automation.py
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
def turn_off(
    self,
    *,
    stop_actions: bool | None = None,
) -> None:
    """Disables an automation.

    Args:
        stop_actions: Stops currently running actions.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="turn_off",
        target={"entity_id": self.entity.entity_id},
        stop_actions=stop_actions,
    )

toggle() -> None

Toggles (enable / disable) an automation.

Source code in src/hassette/models/entities/automation.py
 99
100
101
102
103
104
105
def toggle(self) -> None:
    """Toggles (enable / disable) an automation."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="toggle",
        target={"entity_id": self.entity.entity_id},
    )

trigger(*, skip_condition: bool | None = None) -> None

Triggers the actions of an automation.

Parameters:

Name Type Description Default
skip_condition bool | None

Defines whether or not the conditions will be skipped.

None
Source code in src/hassette/models/entities/automation.py
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
def trigger(
    self,
    *,
    skip_condition: bool | None = None,
) -> None:
    """Triggers the actions of an automation.

    Args:
        skip_condition: Defines whether or not the conditions will be skipped.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="trigger",
        target={"entity_id": self.entity.entity_id},
        skip_condition=skip_condition,
    )

BaseEntity

Bases: BaseModel, Generic[StateT, StateValueT]

Base class for all entities.

Source code in src/hassette/models/entities/base.py
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
class BaseEntity(BaseModel, Generic[StateT, StateValueT]):
    """Base class for all entities."""

    model_config = ConfigDict(extra="allow", arbitrary_types_allowed=True)

    state: StateT
    _sync: "BaseEntitySyncFacade[StateT, StateValueT] | None" = PrivateAttr(default=None, init=False)

    async def refresh(self) -> StateT:
        self.state = cast("StateT", await self.hassette.api.get_state(self.entity_id))
        return self.state

    @property
    def value(self) -> StateValueT:
        return cast("StateValueT", self.state.value)

    @property
    def entity_id(self) -> str:
        return self.state.entity_id

    @property
    def domain(self) -> str:
        return self.state.domain

    @property
    def hassette(self) -> "Hassette":
        """Get the Hassette instance for this entity.

        Resolved at call time from the active Hassette context, not stored on the entity.
        An entity used after the context that created it is torn down (a different thread,
        a reset ContextVar, app shutdown) raises ``RuntimeError``.
        """
        inst = context.HASSETTE_INSTANCE.get(None)
        if inst is None:
            raise RuntimeError("Hassette instance not set in context")

        return inst

    @property
    def api(self) -> "Api":
        """Get the Hassette API instance for this entity. Resolved at call time (see the ``hassette`` property)."""
        return self.hassette.api

    def _get_or_create_sync(self, facade_cls: type[_FacadeT]) -> _FacadeT:
        """Return the cached sync facade, creating it from ``facade_cls`` on first access.

        Single caching authority for ``.sync`` — domain entities override only the facade
        type via their ``sync`` property, not this caching logic. Unsafe to call with a
        ``facade_cls`` that disagrees with an already-cached instance, so it raises rather
        than hand back a wrongly-typed facade (e.g. a subclass that forgot to override ``sync``).
        """
        if self._sync is None:
            self._sync = facade_cls(entity=self)
        if not isinstance(self._sync, facade_cls):
            raise TypeError(f"Cached sync facade is {type(self._sync).__name__}, expected {facade_cls.__name__}")
        return self._sync

    @property
    def sync(self) -> "BaseEntitySyncFacade[StateT, StateValueT]":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(BaseEntitySyncFacade)

hassette: Hassette property

Get the Hassette instance for this entity.

Resolved at call time from the active Hassette context, not stored on the entity. An entity used after the context that created it is torn down (a different thread, a reset ContextVar, app shutdown) raises RuntimeError.

api: Api property

Get the Hassette API instance for this entity. Resolved at call time (see the hassette property).

sync: BaseEntitySyncFacade[StateT, StateValueT] property

Return the typed synchronous facade for this entity.

BaseEntitySyncFacade

Bases: Generic[StateT, StateValueT]

Synchronous facade for BaseEntity to allow easier access to properties without async/await.

Source code in src/hassette/models/entities/base.py
84
85
86
87
88
89
90
class BaseEntitySyncFacade(Generic[StateT, StateValueT]):
    """Synchronous facade for BaseEntity to allow easier access to properties without async/await."""

    entity: BaseEntity[StateT, StateValueT]

    def __init__(self, entity: BaseEntity[StateT, StateValueT]) -> None:
        self.entity = entity

ButtonEntity

Bases: BaseEntity[ButtonState, str]

Source code in src/hassette/models/entities/button.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
class ButtonEntity(BaseEntity[ButtonState, str]):
    @property
    def attributes(self) -> ButtonAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "ButtonEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(ButtonEntitySyncFacade)

    def press(self) -> Coroutine[Any, Any, None]:
        """Presses a button."""
        return self.api.call_service(
            domain=self.domain,
            service="press",
            target={"entity_id": self.entity_id},
        )

sync: ButtonEntitySyncFacade property

Return the typed synchronous facade for this entity.

press() -> Coroutine[Any, Any, None]

Presses a button.

Source code in src/hassette/models/entities/button.py
20
21
22
23
24
25
26
def press(self) -> Coroutine[Any, Any, None]:
    """Presses a button."""
    return self.api.call_service(
        domain=self.domain,
        service="press",
        target={"entity_id": self.entity_id},
    )

ButtonEntitySyncFacade

Bases: BaseEntitySyncFacade[ButtonState, str]

Synchronous facade for ButtonEntity service methods.

Source code in src/hassette/models/entities/button.py
29
30
31
32
33
34
35
36
37
38
class ButtonEntitySyncFacade(BaseEntitySyncFacade[ButtonState, str]):
    """Synchronous facade for ButtonEntity service methods."""

    def press(self) -> None:
        """Presses a button."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="press",
            target={"entity_id": self.entity.entity_id},
        )

press() -> None

Presses a button.

Source code in src/hassette/models/entities/button.py
32
33
34
35
36
37
38
def press(self) -> None:
    """Presses a button."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="press",
        target={"entity_id": self.entity.entity_id},
    )

CameraEntity

Bases: BaseEntity[CameraState, str]

Source code in src/hassette/models/entities/camera.py
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
class CameraEntity(BaseEntity[CameraState, str]):
    @property
    def attributes(self) -> CameraAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "CameraEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(CameraEntitySyncFacade)

    def turn_off(self) -> Coroutine[Any, Any, None]:
        """Turns off a camera."""
        return self.api.call_service(
            domain=self.domain,
            service="turn_off",
            target={"entity_id": self.entity_id},
        )

    def turn_on(self) -> Coroutine[Any, Any, None]:
        """Turns on a camera."""
        return self.api.call_service(
            domain=self.domain,
            service="turn_on",
            target={"entity_id": self.entity_id},
        )

    def enable_motion_detection(self) -> Coroutine[Any, Any, None]:
        """Enables the motion detection of a camera."""
        return self.api.call_service(
            domain=self.domain,
            service="enable_motion_detection",
            target={"entity_id": self.entity_id},
        )

    def disable_motion_detection(self) -> Coroutine[Any, Any, None]:
        """Disables the motion detection of a camera."""
        return self.api.call_service(
            domain=self.domain,
            service="disable_motion_detection",
            target={"entity_id": self.entity_id},
        )

    def snapshot(
        self,
        *,
        filename: str,
    ) -> Coroutine[Any, Any, None]:
        """Takes a snapshot from a camera.

        Args:
            filename: Full path to filename.
        """
        return self.api.call_service(
            domain=self.domain,
            service="snapshot",
            target={"entity_id": self.entity_id},
            filename=filename,
        )

    def play_stream(
        self,
        *,
        media_player: str,
        format: CameraFormat | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Plays a camera stream on a supported media player.

        Args:
            media_player: Media player to stream to.
            format: Stream format supported by the media player.
        """
        return self.api.call_service(
            domain=self.domain,
            service="play_stream",
            target={"entity_id": self.entity_id},
            media_player=media_player,
            format=format,
        )

    def record(
        self,
        *,
        filename: str,
        duration: int | None = None,
        lookback: int | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Creates a recording of a live camera feed.

        Args:
            filename: Full path to filename. Must be mp4.
            duration: Planned duration of the recording. The actual duration may vary.
            lookback: Planned lookback period to include in the recording (in addition to the duration). Only available
                if there is currently an active HLS stream. The actual length of the lookback period may vary.
        """
        return self.api.call_service(
            domain=self.domain,
            service="record",
            target={"entity_id": self.entity_id},
            filename=filename,
            duration=duration,
            lookback=lookback,
        )

sync: CameraEntitySyncFacade property

Return the typed synchronous facade for this entity.

turn_off() -> Coroutine[Any, Any, None]

Turns off a camera.

Source code in src/hassette/models/entities/camera.py
22
23
24
25
26
27
28
def turn_off(self) -> Coroutine[Any, Any, None]:
    """Turns off a camera."""
    return self.api.call_service(
        domain=self.domain,
        service="turn_off",
        target={"entity_id": self.entity_id},
    )

turn_on() -> Coroutine[Any, Any, None]

Turns on a camera.

Source code in src/hassette/models/entities/camera.py
30
31
32
33
34
35
36
def turn_on(self) -> Coroutine[Any, Any, None]:
    """Turns on a camera."""
    return self.api.call_service(
        domain=self.domain,
        service="turn_on",
        target={"entity_id": self.entity_id},
    )

enable_motion_detection() -> Coroutine[Any, Any, None]

Enables the motion detection of a camera.

Source code in src/hassette/models/entities/camera.py
38
39
40
41
42
43
44
def enable_motion_detection(self) -> Coroutine[Any, Any, None]:
    """Enables the motion detection of a camera."""
    return self.api.call_service(
        domain=self.domain,
        service="enable_motion_detection",
        target={"entity_id": self.entity_id},
    )

disable_motion_detection() -> Coroutine[Any, Any, None]

Disables the motion detection of a camera.

Source code in src/hassette/models/entities/camera.py
46
47
48
49
50
51
52
def disable_motion_detection(self) -> Coroutine[Any, Any, None]:
    """Disables the motion detection of a camera."""
    return self.api.call_service(
        domain=self.domain,
        service="disable_motion_detection",
        target={"entity_id": self.entity_id},
    )

snapshot(*, filename: str) -> Coroutine[Any, Any, None]

Takes a snapshot from a camera.

Parameters:

Name Type Description Default
filename str

Full path to filename.

required
Source code in src/hassette/models/entities/camera.py
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
def snapshot(
    self,
    *,
    filename: str,
) -> Coroutine[Any, Any, None]:
    """Takes a snapshot from a camera.

    Args:
        filename: Full path to filename.
    """
    return self.api.call_service(
        domain=self.domain,
        service="snapshot",
        target={"entity_id": self.entity_id},
        filename=filename,
    )

play_stream(*, media_player: str, format: CameraFormat | None = None) -> Coroutine[Any, Any, None]

Plays a camera stream on a supported media player.

Parameters:

Name Type Description Default
media_player str

Media player to stream to.

required
format CameraFormat | None

Stream format supported by the media player.

None
Source code in src/hassette/models/entities/camera.py
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
def play_stream(
    self,
    *,
    media_player: str,
    format: CameraFormat | None = None,
) -> Coroutine[Any, Any, None]:
    """Plays a camera stream on a supported media player.

    Args:
        media_player: Media player to stream to.
        format: Stream format supported by the media player.
    """
    return self.api.call_service(
        domain=self.domain,
        service="play_stream",
        target={"entity_id": self.entity_id},
        media_player=media_player,
        format=format,
    )

record(*, filename: str, duration: int | None = None, lookback: int | None = None) -> Coroutine[Any, Any, None]

Creates a recording of a live camera feed.

Parameters:

Name Type Description Default
filename str

Full path to filename. Must be mp4.

required
duration int | None

Planned duration of the recording. The actual duration may vary.

None
lookback int | None

Planned lookback period to include in the recording (in addition to the duration). Only available if there is currently an active HLS stream. The actual length of the lookback period may vary.

None
Source code in src/hassette/models/entities/camera.py
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
def record(
    self,
    *,
    filename: str,
    duration: int | None = None,
    lookback: int | None = None,
) -> Coroutine[Any, Any, None]:
    """Creates a recording of a live camera feed.

    Args:
        filename: Full path to filename. Must be mp4.
        duration: Planned duration of the recording. The actual duration may vary.
        lookback: Planned lookback period to include in the recording (in addition to the duration). Only available
            if there is currently an active HLS stream. The actual length of the lookback period may vary.
    """
    return self.api.call_service(
        domain=self.domain,
        service="record",
        target={"entity_id": self.entity_id},
        filename=filename,
        duration=duration,
        lookback=lookback,
    )

CameraEntitySyncFacade

Bases: BaseEntitySyncFacade[CameraState, str]

Synchronous facade for CameraEntity service methods.

Source code in src/hassette/models/entities/camera.py
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
class CameraEntitySyncFacade(BaseEntitySyncFacade[CameraState, str]):
    """Synchronous facade for CameraEntity service methods."""

    def turn_off(self) -> None:
        """Turns off a camera."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="turn_off",
            target={"entity_id": self.entity.entity_id},
        )

    def turn_on(self) -> None:
        """Turns on a camera."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="turn_on",
            target={"entity_id": self.entity.entity_id},
        )

    def enable_motion_detection(self) -> None:
        """Enables the motion detection of a camera."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="enable_motion_detection",
            target={"entity_id": self.entity.entity_id},
        )

    def disable_motion_detection(self) -> None:
        """Disables the motion detection of a camera."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="disable_motion_detection",
            target={"entity_id": self.entity.entity_id},
        )

    def snapshot(
        self,
        *,
        filename: str,
    ) -> None:
        """Takes a snapshot from a camera.

        Args:
            filename: Full path to filename.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="snapshot",
            target={"entity_id": self.entity.entity_id},
            filename=filename,
        )

    def play_stream(
        self,
        *,
        media_player: str,
        format: CameraFormat | None = None,
    ) -> None:
        """Plays a camera stream on a supported media player.

        Args:
            media_player: Media player to stream to.
            format: Stream format supported by the media player.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="play_stream",
            target={"entity_id": self.entity.entity_id},
            media_player=media_player,
            format=format,
        )

    def record(
        self,
        *,
        filename: str,
        duration: int | None = None,
        lookback: int | None = None,
    ) -> None:
        """Creates a recording of a live camera feed.

        Args:
            filename: Full path to filename. Must be mp4.
            duration: Planned duration of the recording. The actual duration may vary.
            lookback: Planned lookback period to include in the recording (in addition to the duration). Only available
                if there is currently an active HLS stream. The actual length of the lookback period may vary.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="record",
            target={"entity_id": self.entity.entity_id},
            filename=filename,
            duration=duration,
            lookback=lookback,
        )

turn_off() -> None

Turns off a camera.

Source code in src/hassette/models/entities/camera.py
119
120
121
122
123
124
125
def turn_off(self) -> None:
    """Turns off a camera."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="turn_off",
        target={"entity_id": self.entity.entity_id},
    )

turn_on() -> None

Turns on a camera.

Source code in src/hassette/models/entities/camera.py
127
128
129
130
131
132
133
def turn_on(self) -> None:
    """Turns on a camera."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="turn_on",
        target={"entity_id": self.entity.entity_id},
    )

enable_motion_detection() -> None

Enables the motion detection of a camera.

Source code in src/hassette/models/entities/camera.py
135
136
137
138
139
140
141
def enable_motion_detection(self) -> None:
    """Enables the motion detection of a camera."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="enable_motion_detection",
        target={"entity_id": self.entity.entity_id},
    )

disable_motion_detection() -> None

Disables the motion detection of a camera.

Source code in src/hassette/models/entities/camera.py
143
144
145
146
147
148
149
def disable_motion_detection(self) -> None:
    """Disables the motion detection of a camera."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="disable_motion_detection",
        target={"entity_id": self.entity.entity_id},
    )

snapshot(*, filename: str) -> None

Takes a snapshot from a camera.

Parameters:

Name Type Description Default
filename str

Full path to filename.

required
Source code in src/hassette/models/entities/camera.py
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
def snapshot(
    self,
    *,
    filename: str,
) -> None:
    """Takes a snapshot from a camera.

    Args:
        filename: Full path to filename.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="snapshot",
        target={"entity_id": self.entity.entity_id},
        filename=filename,
    )

play_stream(*, media_player: str, format: CameraFormat | None = None) -> None

Plays a camera stream on a supported media player.

Parameters:

Name Type Description Default
media_player str

Media player to stream to.

required
format CameraFormat | None

Stream format supported by the media player.

None
Source code in src/hassette/models/entities/camera.py
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
def play_stream(
    self,
    *,
    media_player: str,
    format: CameraFormat | None = None,
) -> None:
    """Plays a camera stream on a supported media player.

    Args:
        media_player: Media player to stream to.
        format: Stream format supported by the media player.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="play_stream",
        target={"entity_id": self.entity.entity_id},
        media_player=media_player,
        format=format,
    )

record(*, filename: str, duration: int | None = None, lookback: int | None = None) -> None

Creates a recording of a live camera feed.

Parameters:

Name Type Description Default
filename str

Full path to filename. Must be mp4.

required
duration int | None

Planned duration of the recording. The actual duration may vary.

None
lookback int | None

Planned lookback period to include in the recording (in addition to the duration). Only available if there is currently an active HLS stream. The actual length of the lookback period may vary.

None
Source code in src/hassette/models/entities/camera.py
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
def record(
    self,
    *,
    filename: str,
    duration: int | None = None,
    lookback: int | None = None,
) -> None:
    """Creates a recording of a live camera feed.

    Args:
        filename: Full path to filename. Must be mp4.
        duration: Planned duration of the recording. The actual duration may vary.
        lookback: Planned lookback period to include in the recording (in addition to the duration). Only available
            if there is currently an active HLS stream. The actual length of the lookback period may vary.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="record",
        target={"entity_id": self.entity.entity_id},
        filename=filename,
        duration=duration,
        lookback=lookback,
    )

ClimateEntity

Bases: BaseEntity[ClimateState, str]

Source code in src/hassette/models/entities/climate.py
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
class ClimateEntity(BaseEntity[ClimateState, str]):
    @property
    def attributes(self) -> ClimateAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "ClimateEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(ClimateEntitySyncFacade)

    def set_preset_mode(
        self,
        *,
        preset_mode: str,
    ) -> Coroutine[Any, Any, None]:
        """Sets the preset mode of a thermostat.

        Args:
            preset_mode: Preset mode.
        """
        return self.api.call_service(
            domain=self.domain,
            service="set_preset_mode",
            target={"entity_id": self.entity_id},
            preset_mode=preset_mode,
        )

    def set_temperature(
        self,
        *,
        hvac_mode: HVACMode | None = None,
        target_temp_high: float | None = None,
        target_temp_low: float | None = None,
        temperature: float | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Sets the target temperature of a thermostat.

        Args:
            hvac_mode: HVAC operation mode.
            target_temp_high: The max temperature setpoint.
            target_temp_low: The min temperature setpoint.
            temperature: The temperature setpoint.
        """
        return self.api.call_service(
            domain=self.domain,
            service="set_temperature",
            target={"entity_id": self.entity_id},
            hvac_mode=hvac_mode,
            target_temp_high=target_temp_high,
            target_temp_low=target_temp_low,
            temperature=temperature,
        )

    def set_humidity(
        self,
        *,
        humidity: int,
    ) -> Coroutine[Any, Any, None]:
        """Sets the target humidity of a thermostat.

        Args:
            humidity: Target humidity.
        """
        return self.api.call_service(
            domain=self.domain,
            service="set_humidity",
            target={"entity_id": self.entity_id},
            humidity=humidity,
        )

    def set_fan_mode(
        self,
        *,
        fan_mode: str,
    ) -> Coroutine[Any, Any, None]:
        """Sets the fan mode of a thermostat.

        Args:
            fan_mode: Fan operation mode.
        """
        return self.api.call_service(
            domain=self.domain,
            service="set_fan_mode",
            target={"entity_id": self.entity_id},
            fan_mode=fan_mode,
        )

    def set_hvac_mode(
        self,
        *,
        hvac_mode: HVACMode | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Sets the HVAC mode of a thermostat.

        Args:
            hvac_mode: HVAC operation mode.
        """
        return self.api.call_service(
            domain=self.domain,
            service="set_hvac_mode",
            target={"entity_id": self.entity_id},
            hvac_mode=hvac_mode,
        )

    def set_swing_mode(
        self,
        *,
        swing_mode: str,
    ) -> Coroutine[Any, Any, None]:
        """Sets the swing mode of a thermostat.

        Args:
            swing_mode: Swing operation mode.
        """
        return self.api.call_service(
            domain=self.domain,
            service="set_swing_mode",
            target={"entity_id": self.entity_id},
            swing_mode=swing_mode,
        )

    def set_swing_horizontal_mode(
        self,
        *,
        swing_horizontal_mode: str,
    ) -> Coroutine[Any, Any, None]:
        """Sets the horizontal swing mode of a thermostat.

        Args:
            swing_horizontal_mode: Horizontal swing operation mode.
        """
        return self.api.call_service(
            domain=self.domain,
            service="set_swing_horizontal_mode",
            target={"entity_id": self.entity_id},
            swing_horizontal_mode=swing_horizontal_mode,
        )

    def turn_on(self) -> Coroutine[Any, Any, None]:
        """Turns on a thermostat."""
        return self.api.call_service(
            domain=self.domain,
            service="turn_on",
            target={"entity_id": self.entity_id},
        )

    def turn_off(self) -> Coroutine[Any, Any, None]:
        """Turns off a thermostat."""
        return self.api.call_service(
            domain=self.domain,
            service="turn_off",
            target={"entity_id": self.entity_id},
        )

    def toggle(self) -> Coroutine[Any, Any, None]:
        """Toggles a thermostat on/off."""
        return self.api.call_service(
            domain=self.domain,
            service="toggle",
            target={"entity_id": self.entity_id},
        )

sync: ClimateEntitySyncFacade property

Return the typed synchronous facade for this entity.

set_preset_mode(*, preset_mode: str) -> Coroutine[Any, Any, None]

Sets the preset mode of a thermostat.

Parameters:

Name Type Description Default
preset_mode str

Preset mode.

required
Source code in src/hassette/models/entities/climate.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
def set_preset_mode(
    self,
    *,
    preset_mode: str,
) -> Coroutine[Any, Any, None]:
    """Sets the preset mode of a thermostat.

    Args:
        preset_mode: Preset mode.
    """
    return self.api.call_service(
        domain=self.domain,
        service="set_preset_mode",
        target={"entity_id": self.entity_id},
        preset_mode=preset_mode,
    )

set_temperature(*, hvac_mode: HVACMode | None = None, target_temp_high: float | None = None, target_temp_low: float | None = None, temperature: float | None = None) -> Coroutine[Any, Any, None]

Sets the target temperature of a thermostat.

Parameters:

Name Type Description Default
hvac_mode HVACMode | None

HVAC operation mode.

None
target_temp_high float | None

The max temperature setpoint.

None
target_temp_low float | None

The min temperature setpoint.

None
temperature float | None

The temperature setpoint.

None
Source code in src/hassette/models/entities/climate.py
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
def set_temperature(
    self,
    *,
    hvac_mode: HVACMode | None = None,
    target_temp_high: float | None = None,
    target_temp_low: float | None = None,
    temperature: float | None = None,
) -> Coroutine[Any, Any, None]:
    """Sets the target temperature of a thermostat.

    Args:
        hvac_mode: HVAC operation mode.
        target_temp_high: The max temperature setpoint.
        target_temp_low: The min temperature setpoint.
        temperature: The temperature setpoint.
    """
    return self.api.call_service(
        domain=self.domain,
        service="set_temperature",
        target={"entity_id": self.entity_id},
        hvac_mode=hvac_mode,
        target_temp_high=target_temp_high,
        target_temp_low=target_temp_low,
        temperature=temperature,
    )

set_humidity(*, humidity: int) -> Coroutine[Any, Any, None]

Sets the target humidity of a thermostat.

Parameters:

Name Type Description Default
humidity int

Target humidity.

required
Source code in src/hassette/models/entities/climate.py
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
def set_humidity(
    self,
    *,
    humidity: int,
) -> Coroutine[Any, Any, None]:
    """Sets the target humidity of a thermostat.

    Args:
        humidity: Target humidity.
    """
    return self.api.call_service(
        domain=self.domain,
        service="set_humidity",
        target={"entity_id": self.entity_id},
        humidity=humidity,
    )

set_fan_mode(*, fan_mode: str) -> Coroutine[Any, Any, None]

Sets the fan mode of a thermostat.

Parameters:

Name Type Description Default
fan_mode str

Fan operation mode.

required
Source code in src/hassette/models/entities/climate.py
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
def set_fan_mode(
    self,
    *,
    fan_mode: str,
) -> Coroutine[Any, Any, None]:
    """Sets the fan mode of a thermostat.

    Args:
        fan_mode: Fan operation mode.
    """
    return self.api.call_service(
        domain=self.domain,
        service="set_fan_mode",
        target={"entity_id": self.entity_id},
        fan_mode=fan_mode,
    )

set_hvac_mode(*, hvac_mode: HVACMode | None = None) -> Coroutine[Any, Any, None]

Sets the HVAC mode of a thermostat.

Parameters:

Name Type Description Default
hvac_mode HVACMode | None

HVAC operation mode.

None
Source code in src/hassette/models/entities/climate.py
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
def set_hvac_mode(
    self,
    *,
    hvac_mode: HVACMode | None = None,
) -> Coroutine[Any, Any, None]:
    """Sets the HVAC mode of a thermostat.

    Args:
        hvac_mode: HVAC operation mode.
    """
    return self.api.call_service(
        domain=self.domain,
        service="set_hvac_mode",
        target={"entity_id": self.entity_id},
        hvac_mode=hvac_mode,
    )

set_swing_mode(*, swing_mode: str) -> Coroutine[Any, Any, None]

Sets the swing mode of a thermostat.

Parameters:

Name Type Description Default
swing_mode str

Swing operation mode.

required
Source code in src/hassette/models/entities/climate.py
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
def set_swing_mode(
    self,
    *,
    swing_mode: str,
) -> Coroutine[Any, Any, None]:
    """Sets the swing mode of a thermostat.

    Args:
        swing_mode: Swing operation mode.
    """
    return self.api.call_service(
        domain=self.domain,
        service="set_swing_mode",
        target={"entity_id": self.entity_id},
        swing_mode=swing_mode,
    )

set_swing_horizontal_mode(*, swing_horizontal_mode: str) -> Coroutine[Any, Any, None]

Sets the horizontal swing mode of a thermostat.

Parameters:

Name Type Description Default
swing_horizontal_mode str

Horizontal swing operation mode.

required
Source code in src/hassette/models/entities/climate.py
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
def set_swing_horizontal_mode(
    self,
    *,
    swing_horizontal_mode: str,
) -> Coroutine[Any, Any, None]:
    """Sets the horizontal swing mode of a thermostat.

    Args:
        swing_horizontal_mode: Horizontal swing operation mode.
    """
    return self.api.call_service(
        domain=self.domain,
        service="set_swing_horizontal_mode",
        target={"entity_id": self.entity_id},
        swing_horizontal_mode=swing_horizontal_mode,
    )

turn_on() -> Coroutine[Any, Any, None]

Turns on a thermostat.

Source code in src/hassette/models/entities/climate.py
148
149
150
151
152
153
154
def turn_on(self) -> Coroutine[Any, Any, None]:
    """Turns on a thermostat."""
    return self.api.call_service(
        domain=self.domain,
        service="turn_on",
        target={"entity_id": self.entity_id},
    )

turn_off() -> Coroutine[Any, Any, None]

Turns off a thermostat.

Source code in src/hassette/models/entities/climate.py
156
157
158
159
160
161
162
def turn_off(self) -> Coroutine[Any, Any, None]:
    """Turns off a thermostat."""
    return self.api.call_service(
        domain=self.domain,
        service="turn_off",
        target={"entity_id": self.entity_id},
    )

toggle() -> Coroutine[Any, Any, None]

Toggles a thermostat on/off.

Source code in src/hassette/models/entities/climate.py
164
165
166
167
168
169
170
def toggle(self) -> Coroutine[Any, Any, None]:
    """Toggles a thermostat on/off."""
    return self.api.call_service(
        domain=self.domain,
        service="toggle",
        target={"entity_id": self.entity_id},
    )

ClimateEntitySyncFacade

Bases: BaseEntitySyncFacade[ClimateState, str]

Synchronous facade for ClimateEntity service methods.

Source code in src/hassette/models/entities/climate.py
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
class ClimateEntitySyncFacade(BaseEntitySyncFacade[ClimateState, str]):
    """Synchronous facade for ClimateEntity service methods."""

    def set_preset_mode(
        self,
        *,
        preset_mode: str,
    ) -> None:
        """Sets the preset mode of a thermostat.

        Args:
            preset_mode: Preset mode.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="set_preset_mode",
            target={"entity_id": self.entity.entity_id},
            preset_mode=preset_mode,
        )

    def set_temperature(
        self,
        *,
        hvac_mode: HVACMode | None = None,
        target_temp_high: float | None = None,
        target_temp_low: float | None = None,
        temperature: float | None = None,
    ) -> None:
        """Sets the target temperature of a thermostat.

        Args:
            hvac_mode: HVAC operation mode.
            target_temp_high: The max temperature setpoint.
            target_temp_low: The min temperature setpoint.
            temperature: The temperature setpoint.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="set_temperature",
            target={"entity_id": self.entity.entity_id},
            hvac_mode=hvac_mode,
            target_temp_high=target_temp_high,
            target_temp_low=target_temp_low,
            temperature=temperature,
        )

    def set_humidity(
        self,
        *,
        humidity: int,
    ) -> None:
        """Sets the target humidity of a thermostat.

        Args:
            humidity: Target humidity.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="set_humidity",
            target={"entity_id": self.entity.entity_id},
            humidity=humidity,
        )

    def set_fan_mode(
        self,
        *,
        fan_mode: str,
    ) -> None:
        """Sets the fan mode of a thermostat.

        Args:
            fan_mode: Fan operation mode.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="set_fan_mode",
            target={"entity_id": self.entity.entity_id},
            fan_mode=fan_mode,
        )

    def set_hvac_mode(
        self,
        *,
        hvac_mode: HVACMode | None = None,
    ) -> None:
        """Sets the HVAC mode of a thermostat.

        Args:
            hvac_mode: HVAC operation mode.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="set_hvac_mode",
            target={"entity_id": self.entity.entity_id},
            hvac_mode=hvac_mode,
        )

    def set_swing_mode(
        self,
        *,
        swing_mode: str,
    ) -> None:
        """Sets the swing mode of a thermostat.

        Args:
            swing_mode: Swing operation mode.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="set_swing_mode",
            target={"entity_id": self.entity.entity_id},
            swing_mode=swing_mode,
        )

    def set_swing_horizontal_mode(
        self,
        *,
        swing_horizontal_mode: str,
    ) -> None:
        """Sets the horizontal swing mode of a thermostat.

        Args:
            swing_horizontal_mode: Horizontal swing operation mode.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="set_swing_horizontal_mode",
            target={"entity_id": self.entity.entity_id},
            swing_horizontal_mode=swing_horizontal_mode,
        )

    def turn_on(self) -> None:
        """Turns on a thermostat."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="turn_on",
            target={"entity_id": self.entity.entity_id},
        )

    def turn_off(self) -> None:
        """Turns off a thermostat."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="turn_off",
            target={"entity_id": self.entity.entity_id},
        )

    def toggle(self) -> None:
        """Toggles a thermostat on/off."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="toggle",
            target={"entity_id": self.entity.entity_id},
        )

set_preset_mode(*, preset_mode: str) -> None

Sets the preset mode of a thermostat.

Parameters:

Name Type Description Default
preset_mode str

Preset mode.

required
Source code in src/hassette/models/entities/climate.py
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
def set_preset_mode(
    self,
    *,
    preset_mode: str,
) -> None:
    """Sets the preset mode of a thermostat.

    Args:
        preset_mode: Preset mode.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="set_preset_mode",
        target={"entity_id": self.entity.entity_id},
        preset_mode=preset_mode,
    )

set_temperature(*, hvac_mode: HVACMode | None = None, target_temp_high: float | None = None, target_temp_low: float | None = None, temperature: float | None = None) -> None

Sets the target temperature of a thermostat.

Parameters:

Name Type Description Default
hvac_mode HVACMode | None

HVAC operation mode.

None
target_temp_high float | None

The max temperature setpoint.

None
target_temp_low float | None

The min temperature setpoint.

None
temperature float | None

The temperature setpoint.

None
Source code in src/hassette/models/entities/climate.py
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
def set_temperature(
    self,
    *,
    hvac_mode: HVACMode | None = None,
    target_temp_high: float | None = None,
    target_temp_low: float | None = None,
    temperature: float | None = None,
) -> None:
    """Sets the target temperature of a thermostat.

    Args:
        hvac_mode: HVAC operation mode.
        target_temp_high: The max temperature setpoint.
        target_temp_low: The min temperature setpoint.
        temperature: The temperature setpoint.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="set_temperature",
        target={"entity_id": self.entity.entity_id},
        hvac_mode=hvac_mode,
        target_temp_high=target_temp_high,
        target_temp_low=target_temp_low,
        temperature=temperature,
    )

set_humidity(*, humidity: int) -> None

Sets the target humidity of a thermostat.

Parameters:

Name Type Description Default
humidity int

Target humidity.

required
Source code in src/hassette/models/entities/climate.py
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
def set_humidity(
    self,
    *,
    humidity: int,
) -> None:
    """Sets the target humidity of a thermostat.

    Args:
        humidity: Target humidity.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="set_humidity",
        target={"entity_id": self.entity.entity_id},
        humidity=humidity,
    )

set_fan_mode(*, fan_mode: str) -> None

Sets the fan mode of a thermostat.

Parameters:

Name Type Description Default
fan_mode str

Fan operation mode.

required
Source code in src/hassette/models/entities/climate.py
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
def set_fan_mode(
    self,
    *,
    fan_mode: str,
) -> None:
    """Sets the fan mode of a thermostat.

    Args:
        fan_mode: Fan operation mode.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="set_fan_mode",
        target={"entity_id": self.entity.entity_id},
        fan_mode=fan_mode,
    )

set_hvac_mode(*, hvac_mode: HVACMode | None = None) -> None

Sets the HVAC mode of a thermostat.

Parameters:

Name Type Description Default
hvac_mode HVACMode | None

HVAC operation mode.

None
Source code in src/hassette/models/entities/climate.py
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
def set_hvac_mode(
    self,
    *,
    hvac_mode: HVACMode | None = None,
) -> None:
    """Sets the HVAC mode of a thermostat.

    Args:
        hvac_mode: HVAC operation mode.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="set_hvac_mode",
        target={"entity_id": self.entity.entity_id},
        hvac_mode=hvac_mode,
    )

set_swing_mode(*, swing_mode: str) -> None

Sets the swing mode of a thermostat.

Parameters:

Name Type Description Default
swing_mode str

Swing operation mode.

required
Source code in src/hassette/models/entities/climate.py
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
def set_swing_mode(
    self,
    *,
    swing_mode: str,
) -> None:
    """Sets the swing mode of a thermostat.

    Args:
        swing_mode: Swing operation mode.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="set_swing_mode",
        target={"entity_id": self.entity.entity_id},
        swing_mode=swing_mode,
    )

set_swing_horizontal_mode(*, swing_horizontal_mode: str) -> None

Sets the horizontal swing mode of a thermostat.

Parameters:

Name Type Description Default
swing_horizontal_mode str

Horizontal swing operation mode.

required
Source code in src/hassette/models/entities/climate.py
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
def set_swing_horizontal_mode(
    self,
    *,
    swing_horizontal_mode: str,
) -> None:
    """Sets the horizontal swing mode of a thermostat.

    Args:
        swing_horizontal_mode: Horizontal swing operation mode.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="set_swing_horizontal_mode",
        target={"entity_id": self.entity.entity_id},
        swing_horizontal_mode=swing_horizontal_mode,
    )

turn_on() -> None

Turns on a thermostat.

Source code in src/hassette/models/entities/climate.py
304
305
306
307
308
309
310
def turn_on(self) -> None:
    """Turns on a thermostat."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="turn_on",
        target={"entity_id": self.entity.entity_id},
    )

turn_off() -> None

Turns off a thermostat.

Source code in src/hassette/models/entities/climate.py
312
313
314
315
316
317
318
def turn_off(self) -> None:
    """Turns off a thermostat."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="turn_off",
        target={"entity_id": self.entity.entity_id},
    )

toggle() -> None

Toggles a thermostat on/off.

Source code in src/hassette/models/entities/climate.py
320
321
322
323
324
325
326
def toggle(self) -> None:
    """Toggles a thermostat on/off."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="toggle",
        target={"entity_id": self.entity.entity_id},
    )

CoverEntity

Bases: BaseEntity[CoverState, str]

Source code in src/hassette/models/entities/cover.py
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
class CoverEntity(BaseEntity[CoverState, str]):
    @property
    def attributes(self) -> CoverAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "CoverEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(CoverEntitySyncFacade)

    def open_cover(self) -> Coroutine[Any, Any, None]:
        """Opens a cover."""
        return self.api.call_service(
            domain=self.domain,
            service="open_cover",
            target={"entity_id": self.entity_id},
        )

    def close_cover(self) -> Coroutine[Any, Any, None]:
        """Closes a cover."""
        return self.api.call_service(
            domain=self.domain,
            service="close_cover",
            target={"entity_id": self.entity_id},
        )

    def toggle(self) -> Coroutine[Any, Any, None]:
        """Toggles a cover open/closed."""
        return self.api.call_service(
            domain=self.domain,
            service="toggle",
            target={"entity_id": self.entity_id},
        )

    def set_cover_position(
        self,
        *,
        position: int,
    ) -> Coroutine[Any, Any, None]:
        """Moves a cover to a specific position.

        Args:
            position: Target position.
        """
        return self.api.call_service(
            domain=self.domain,
            service="set_cover_position",
            target={"entity_id": self.entity_id},
            position=position,
        )

    def stop_cover(self) -> Coroutine[Any, Any, None]:
        """Stops a cover's movement."""
        return self.api.call_service(
            domain=self.domain,
            service="stop_cover",
            target={"entity_id": self.entity_id},
        )

    def open_cover_tilt(self) -> Coroutine[Any, Any, None]:
        """Tilts a cover open."""
        return self.api.call_service(
            domain=self.domain,
            service="open_cover_tilt",
            target={"entity_id": self.entity_id},
        )

    def close_cover_tilt(self) -> Coroutine[Any, Any, None]:
        """Tilts a cover to close."""
        return self.api.call_service(
            domain=self.domain,
            service="close_cover_tilt",
            target={"entity_id": self.entity_id},
        )

    def toggle_cover_tilt(self) -> Coroutine[Any, Any, None]:
        """Toggles a cover tilt open/closed."""
        return self.api.call_service(
            domain=self.domain,
            service="toggle_cover_tilt",
            target={"entity_id": self.entity_id},
        )

    def set_cover_tilt_position(
        self,
        *,
        tilt_position: int,
    ) -> Coroutine[Any, Any, None]:
        """Moves a cover tilt to a specific position.

        Args:
            tilt_position: Target tilt positition.
        """
        return self.api.call_service(
            domain=self.domain,
            service="set_cover_tilt_position",
            target={"entity_id": self.entity_id},
            tilt_position=tilt_position,
        )

    def stop_cover_tilt(self) -> Coroutine[Any, Any, None]:
        """Stops a tilting cover movement."""
        return self.api.call_service(
            domain=self.domain,
            service="stop_cover_tilt",
            target={"entity_id": self.entity_id},
        )

sync: CoverEntitySyncFacade property

Return the typed synchronous facade for this entity.

open_cover() -> Coroutine[Any, Any, None]

Opens a cover.

Source code in src/hassette/models/entities/cover.py
20
21
22
23
24
25
26
def open_cover(self) -> Coroutine[Any, Any, None]:
    """Opens a cover."""
    return self.api.call_service(
        domain=self.domain,
        service="open_cover",
        target={"entity_id": self.entity_id},
    )

close_cover() -> Coroutine[Any, Any, None]

Closes a cover.

Source code in src/hassette/models/entities/cover.py
28
29
30
31
32
33
34
def close_cover(self) -> Coroutine[Any, Any, None]:
    """Closes a cover."""
    return self.api.call_service(
        domain=self.domain,
        service="close_cover",
        target={"entity_id": self.entity_id},
    )

toggle() -> Coroutine[Any, Any, None]

Toggles a cover open/closed.

Source code in src/hassette/models/entities/cover.py
36
37
38
39
40
41
42
def toggle(self) -> Coroutine[Any, Any, None]:
    """Toggles a cover open/closed."""
    return self.api.call_service(
        domain=self.domain,
        service="toggle",
        target={"entity_id": self.entity_id},
    )

set_cover_position(*, position: int) -> Coroutine[Any, Any, None]

Moves a cover to a specific position.

Parameters:

Name Type Description Default
position int

Target position.

required
Source code in src/hassette/models/entities/cover.py
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
def set_cover_position(
    self,
    *,
    position: int,
) -> Coroutine[Any, Any, None]:
    """Moves a cover to a specific position.

    Args:
        position: Target position.
    """
    return self.api.call_service(
        domain=self.domain,
        service="set_cover_position",
        target={"entity_id": self.entity_id},
        position=position,
    )

stop_cover() -> Coroutine[Any, Any, None]

Stops a cover's movement.

Source code in src/hassette/models/entities/cover.py
61
62
63
64
65
66
67
def stop_cover(self) -> Coroutine[Any, Any, None]:
    """Stops a cover's movement."""
    return self.api.call_service(
        domain=self.domain,
        service="stop_cover",
        target={"entity_id": self.entity_id},
    )

open_cover_tilt() -> Coroutine[Any, Any, None]

Tilts a cover open.

Source code in src/hassette/models/entities/cover.py
69
70
71
72
73
74
75
def open_cover_tilt(self) -> Coroutine[Any, Any, None]:
    """Tilts a cover open."""
    return self.api.call_service(
        domain=self.domain,
        service="open_cover_tilt",
        target={"entity_id": self.entity_id},
    )

close_cover_tilt() -> Coroutine[Any, Any, None]

Tilts a cover to close.

Source code in src/hassette/models/entities/cover.py
77
78
79
80
81
82
83
def close_cover_tilt(self) -> Coroutine[Any, Any, None]:
    """Tilts a cover to close."""
    return self.api.call_service(
        domain=self.domain,
        service="close_cover_tilt",
        target={"entity_id": self.entity_id},
    )

toggle_cover_tilt() -> Coroutine[Any, Any, None]

Toggles a cover tilt open/closed.

Source code in src/hassette/models/entities/cover.py
85
86
87
88
89
90
91
def toggle_cover_tilt(self) -> Coroutine[Any, Any, None]:
    """Toggles a cover tilt open/closed."""
    return self.api.call_service(
        domain=self.domain,
        service="toggle_cover_tilt",
        target={"entity_id": self.entity_id},
    )

set_cover_tilt_position(*, tilt_position: int) -> Coroutine[Any, Any, None]

Moves a cover tilt to a specific position.

Parameters:

Name Type Description Default
tilt_position int

Target tilt positition.

required
Source code in src/hassette/models/entities/cover.py
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
def set_cover_tilt_position(
    self,
    *,
    tilt_position: int,
) -> Coroutine[Any, Any, None]:
    """Moves a cover tilt to a specific position.

    Args:
        tilt_position: Target tilt positition.
    """
    return self.api.call_service(
        domain=self.domain,
        service="set_cover_tilt_position",
        target={"entity_id": self.entity_id},
        tilt_position=tilt_position,
    )

stop_cover_tilt() -> Coroutine[Any, Any, None]

Stops a tilting cover movement.

Source code in src/hassette/models/entities/cover.py
110
111
112
113
114
115
116
def stop_cover_tilt(self) -> Coroutine[Any, Any, None]:
    """Stops a tilting cover movement."""
    return self.api.call_service(
        domain=self.domain,
        service="stop_cover_tilt",
        target={"entity_id": self.entity_id},
    )

CoverEntitySyncFacade

Bases: BaseEntitySyncFacade[CoverState, str]

Synchronous facade for CoverEntity service methods.

Source code in src/hassette/models/entities/cover.py
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
class CoverEntitySyncFacade(BaseEntitySyncFacade[CoverState, str]):
    """Synchronous facade for CoverEntity service methods."""

    def open_cover(self) -> None:
        """Opens a cover."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="open_cover",
            target={"entity_id": self.entity.entity_id},
        )

    def close_cover(self) -> None:
        """Closes a cover."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="close_cover",
            target={"entity_id": self.entity.entity_id},
        )

    def toggle(self) -> None:
        """Toggles a cover open/closed."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="toggle",
            target={"entity_id": self.entity.entity_id},
        )

    def set_cover_position(
        self,
        *,
        position: int,
    ) -> None:
        """Moves a cover to a specific position.

        Args:
            position: Target position.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="set_cover_position",
            target={"entity_id": self.entity.entity_id},
            position=position,
        )

    def stop_cover(self) -> None:
        """Stops a cover's movement."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="stop_cover",
            target={"entity_id": self.entity.entity_id},
        )

    def open_cover_tilt(self) -> None:
        """Tilts a cover open."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="open_cover_tilt",
            target={"entity_id": self.entity.entity_id},
        )

    def close_cover_tilt(self) -> None:
        """Tilts a cover to close."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="close_cover_tilt",
            target={"entity_id": self.entity.entity_id},
        )

    def toggle_cover_tilt(self) -> None:
        """Toggles a cover tilt open/closed."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="toggle_cover_tilt",
            target={"entity_id": self.entity.entity_id},
        )

    def set_cover_tilt_position(
        self,
        *,
        tilt_position: int,
    ) -> None:
        """Moves a cover tilt to a specific position.

        Args:
            tilt_position: Target tilt positition.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="set_cover_tilt_position",
            target={"entity_id": self.entity.entity_id},
            tilt_position=tilt_position,
        )

    def stop_cover_tilt(self) -> None:
        """Stops a tilting cover movement."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="stop_cover_tilt",
            target={"entity_id": self.entity.entity_id},
        )

open_cover() -> None

Opens a cover.

Source code in src/hassette/models/entities/cover.py
122
123
124
125
126
127
128
def open_cover(self) -> None:
    """Opens a cover."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="open_cover",
        target={"entity_id": self.entity.entity_id},
    )

close_cover() -> None

Closes a cover.

Source code in src/hassette/models/entities/cover.py
130
131
132
133
134
135
136
def close_cover(self) -> None:
    """Closes a cover."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="close_cover",
        target={"entity_id": self.entity.entity_id},
    )

toggle() -> None

Toggles a cover open/closed.

Source code in src/hassette/models/entities/cover.py
138
139
140
141
142
143
144
def toggle(self) -> None:
    """Toggles a cover open/closed."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="toggle",
        target={"entity_id": self.entity.entity_id},
    )

set_cover_position(*, position: int) -> None

Moves a cover to a specific position.

Parameters:

Name Type Description Default
position int

Target position.

required
Source code in src/hassette/models/entities/cover.py
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
def set_cover_position(
    self,
    *,
    position: int,
) -> None:
    """Moves a cover to a specific position.

    Args:
        position: Target position.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="set_cover_position",
        target={"entity_id": self.entity.entity_id},
        position=position,
    )

stop_cover() -> None

Stops a cover's movement.

Source code in src/hassette/models/entities/cover.py
163
164
165
166
167
168
169
def stop_cover(self) -> None:
    """Stops a cover's movement."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="stop_cover",
        target={"entity_id": self.entity.entity_id},
    )

open_cover_tilt() -> None

Tilts a cover open.

Source code in src/hassette/models/entities/cover.py
171
172
173
174
175
176
177
def open_cover_tilt(self) -> None:
    """Tilts a cover open."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="open_cover_tilt",
        target={"entity_id": self.entity.entity_id},
    )

close_cover_tilt() -> None

Tilts a cover to close.

Source code in src/hassette/models/entities/cover.py
179
180
181
182
183
184
185
def close_cover_tilt(self) -> None:
    """Tilts a cover to close."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="close_cover_tilt",
        target={"entity_id": self.entity.entity_id},
    )

toggle_cover_tilt() -> None

Toggles a cover tilt open/closed.

Source code in src/hassette/models/entities/cover.py
187
188
189
190
191
192
193
def toggle_cover_tilt(self) -> None:
    """Toggles a cover tilt open/closed."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="toggle_cover_tilt",
        target={"entity_id": self.entity.entity_id},
    )

set_cover_tilt_position(*, tilt_position: int) -> None

Moves a cover tilt to a specific position.

Parameters:

Name Type Description Default
tilt_position int

Target tilt positition.

required
Source code in src/hassette/models/entities/cover.py
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
def set_cover_tilt_position(
    self,
    *,
    tilt_position: int,
) -> None:
    """Moves a cover tilt to a specific position.

    Args:
        tilt_position: Target tilt positition.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="set_cover_tilt_position",
        target={"entity_id": self.entity.entity_id},
        tilt_position=tilt_position,
    )

stop_cover_tilt() -> None

Stops a tilting cover movement.

Source code in src/hassette/models/entities/cover.py
212
213
214
215
216
217
218
def stop_cover_tilt(self) -> None:
    """Stops a tilting cover movement."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="stop_cover_tilt",
        target={"entity_id": self.entity.entity_id},
    )

DateEntity

Bases: BaseEntity[DateState, str]

Source code in src/hassette/models/entities/date.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
class DateEntity(BaseEntity[DateState, str]):
    @property
    def attributes(self) -> DateAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "DateEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(DateEntitySyncFacade)

    def set_value(
        self,
        *,
        date: str,
    ) -> Coroutine[Any, Any, None]:
        """Sets the value of a date.

        Args:
            date: The date to set.
        """
        return self.api.call_service(
            domain=self.domain,
            service="set_value",
            target={"entity_id": self.entity_id},
            date=date,
        )

sync: DateEntitySyncFacade property

Return the typed synchronous facade for this entity.

set_value(*, date: str) -> Coroutine[Any, Any, None]

Sets the value of a date.

Parameters:

Name Type Description Default
date str

The date to set.

required
Source code in src/hassette/models/entities/date.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
def set_value(
    self,
    *,
    date: str,
) -> Coroutine[Any, Any, None]:
    """Sets the value of a date.

    Args:
        date: The date to set.
    """
    return self.api.call_service(
        domain=self.domain,
        service="set_value",
        target={"entity_id": self.entity_id},
        date=date,
    )

DateEntitySyncFacade

Bases: BaseEntitySyncFacade[DateState, str]

Synchronous facade for DateEntity service methods.

Source code in src/hassette/models/entities/date.py
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
class DateEntitySyncFacade(BaseEntitySyncFacade[DateState, str]):
    """Synchronous facade for DateEntity service methods."""

    def set_value(
        self,
        *,
        date: str,
    ) -> None:
        """Sets the value of a date.

        Args:
            date: The date to set.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="set_value",
            target={"entity_id": self.entity.entity_id},
            date=date,
        )

set_value(*, date: str) -> None

Sets the value of a date.

Parameters:

Name Type Description Default
date str

The date to set.

required
Source code in src/hassette/models/entities/date.py
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
def set_value(
    self,
    *,
    date: str,
) -> None:
    """Sets the value of a date.

    Args:
        date: The date to set.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="set_value",
        target={"entity_id": self.entity.entity_id},
        date=date,
    )

DateTimeEntity

Bases: BaseEntity[DateTimeState, str]

Source code in src/hassette/models/entities/datetime.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
class DateTimeEntity(BaseEntity[DateTimeState, str]):
    @property
    def attributes(self) -> DateTimeAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "DateTimeEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(DateTimeEntitySyncFacade)

    def set_value(
        self,
        *,
        datetime: str,
    ) -> Coroutine[Any, Any, None]:
        """Sets the value of a date/time.

        Args:
            datetime: The date/time to set. The time zone of the Home Assistant instance is assumed.
        """
        return self.api.call_service(
            domain=self.domain,
            service="set_value",
            target={"entity_id": self.entity_id},
            datetime=datetime,
        )

sync: DateTimeEntitySyncFacade property

Return the typed synchronous facade for this entity.

set_value(*, datetime: str) -> Coroutine[Any, Any, None]

Sets the value of a date/time.

Parameters:

Name Type Description Default
datetime str

The date/time to set. The time zone of the Home Assistant instance is assumed.

required
Source code in src/hassette/models/entities/datetime.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
def set_value(
    self,
    *,
    datetime: str,
) -> Coroutine[Any, Any, None]:
    """Sets the value of a date/time.

    Args:
        datetime: The date/time to set. The time zone of the Home Assistant instance is assumed.
    """
    return self.api.call_service(
        domain=self.domain,
        service="set_value",
        target={"entity_id": self.entity_id},
        datetime=datetime,
    )

DateTimeEntitySyncFacade

Bases: BaseEntitySyncFacade[DateTimeState, str]

Synchronous facade for DateTimeEntity service methods.

Source code in src/hassette/models/entities/datetime.py
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
class DateTimeEntitySyncFacade(BaseEntitySyncFacade[DateTimeState, str]):
    """Synchronous facade for DateTimeEntity service methods."""

    def set_value(
        self,
        *,
        datetime: str,
    ) -> None:
        """Sets the value of a date/time.

        Args:
            datetime: The date/time to set. The time zone of the Home Assistant instance is assumed.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="set_value",
            target={"entity_id": self.entity.entity_id},
            datetime=datetime,
        )

set_value(*, datetime: str) -> None

Sets the value of a date/time.

Parameters:

Name Type Description Default
datetime str

The date/time to set. The time zone of the Home Assistant instance is assumed.

required
Source code in src/hassette/models/entities/datetime.py
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
def set_value(
    self,
    *,
    datetime: str,
) -> None:
    """Sets the value of a date/time.

    Args:
        datetime: The date/time to set. The time zone of the Home Assistant instance is assumed.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="set_value",
        target={"entity_id": self.entity.entity_id},
        datetime=datetime,
    )

FanEntity

Bases: BaseEntity[FanState, str]

Source code in src/hassette/models/entities/fan.py
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
class FanEntity(BaseEntity[FanState, str]):
    @property
    def attributes(self) -> FanAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "FanEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(FanEntitySyncFacade)

    def set_preset_mode(
        self,
        *,
        preset_mode: str,
    ) -> Coroutine[Any, Any, None]:
        """Sets the preset mode of a fan.

        Args:
            preset_mode: Preset fan mode.
        """
        return self.api.call_service(
            domain=self.domain,
            service="set_preset_mode",
            target={"entity_id": self.entity_id},
            preset_mode=preset_mode,
        )

    def set_percentage(
        self,
        *,
        percentage: int,
    ) -> Coroutine[Any, Any, None]:
        """Sets the speed of a fan.

        Args:
            percentage: Speed of the fan.
        """
        return self.api.call_service(
            domain=self.domain,
            service="set_percentage",
            target={"entity_id": self.entity_id},
            percentage=percentage,
        )

    def turn_on(
        self,
        *,
        percentage: int | None = None,
        preset_mode: str | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Turns on a fan.

        Args:
            percentage: Speed of the fan.
            preset_mode: Preset fan mode.
        """
        return self.api.call_service(
            domain=self.domain,
            service="turn_on",
            target={"entity_id": self.entity_id},
            percentage=percentage,
            preset_mode=preset_mode,
        )

    def turn_off(self) -> Coroutine[Any, Any, None]:
        """Turns off a fan."""
        return self.api.call_service(
            domain=self.domain,
            service="turn_off",
            target={"entity_id": self.entity_id},
        )

    def oscillate(
        self,
        *,
        oscillating: bool,
    ) -> Coroutine[Any, Any, None]:
        """Controls the oscillation of a fan.

        Args:
            oscillating: Turns oscillation on/off.
        """
        return self.api.call_service(
            domain=self.domain,
            service="oscillate",
            target={"entity_id": self.entity_id},
            oscillating=oscillating,
        )

    def toggle(self) -> Coroutine[Any, Any, None]:
        """Toggles a fan on/off."""
        return self.api.call_service(
            domain=self.domain,
            service="toggle",
            target={"entity_id": self.entity_id},
        )

    def set_direction(
        self,
        *,
        direction: FanDirection,
    ) -> Coroutine[Any, Any, None]:
        """Sets a fan's rotation direction.

        Args:
            direction: Direction of the fan rotation.
        """
        return self.api.call_service(
            domain=self.domain,
            service="set_direction",
            target={"entity_id": self.entity_id},
            direction=direction,
        )

    def increase_speed(
        self,
        *,
        percentage_step: int | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Increases the speed of a fan.

        Args:
            percentage_step: Percentage step by which the speed should be increased.
        """
        return self.api.call_service(
            domain=self.domain,
            service="increase_speed",
            target={"entity_id": self.entity_id},
            percentage_step=percentage_step,
        )

    def decrease_speed(
        self,
        *,
        percentage_step: int | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Decreases the speed of a fan.

        Args:
            percentage_step: Percentage step by which the speed should be decreased.
        """
        return self.api.call_service(
            domain=self.domain,
            service="decrease_speed",
            target={"entity_id": self.entity_id},
            percentage_step=percentage_step,
        )

sync: FanEntitySyncFacade property

Return the typed synchronous facade for this entity.

set_preset_mode(*, preset_mode: str) -> Coroutine[Any, Any, None]

Sets the preset mode of a fan.

Parameters:

Name Type Description Default
preset_mode str

Preset fan mode.

required
Source code in src/hassette/models/entities/fan.py
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
def set_preset_mode(
    self,
    *,
    preset_mode: str,
) -> Coroutine[Any, Any, None]:
    """Sets the preset mode of a fan.

    Args:
        preset_mode: Preset fan mode.
    """
    return self.api.call_service(
        domain=self.domain,
        service="set_preset_mode",
        target={"entity_id": self.entity_id},
        preset_mode=preset_mode,
    )

set_percentage(*, percentage: int) -> Coroutine[Any, Any, None]

Sets the speed of a fan.

Parameters:

Name Type Description Default
percentage int

Speed of the fan.

required
Source code in src/hassette/models/entities/fan.py
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
def set_percentage(
    self,
    *,
    percentage: int,
) -> Coroutine[Any, Any, None]:
    """Sets the speed of a fan.

    Args:
        percentage: Speed of the fan.
    """
    return self.api.call_service(
        domain=self.domain,
        service="set_percentage",
        target={"entity_id": self.entity_id},
        percentage=percentage,
    )

turn_on(*, percentage: int | None = None, preset_mode: str | None = None) -> Coroutine[Any, Any, None]

Turns on a fan.

Parameters:

Name Type Description Default
percentage int | None

Speed of the fan.

None
preset_mode str | None

Preset fan mode.

None
Source code in src/hassette/models/entities/fan.py
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
def turn_on(
    self,
    *,
    percentage: int | None = None,
    preset_mode: str | None = None,
) -> Coroutine[Any, Any, None]:
    """Turns on a fan.

    Args:
        percentage: Speed of the fan.
        preset_mode: Preset fan mode.
    """
    return self.api.call_service(
        domain=self.domain,
        service="turn_on",
        target={"entity_id": self.entity_id},
        percentage=percentage,
        preset_mode=preset_mode,
    )

turn_off() -> Coroutine[Any, Any, None]

Turns off a fan.

Source code in src/hassette/models/entities/fan.py
76
77
78
79
80
81
82
def turn_off(self) -> Coroutine[Any, Any, None]:
    """Turns off a fan."""
    return self.api.call_service(
        domain=self.domain,
        service="turn_off",
        target={"entity_id": self.entity_id},
    )

oscillate(*, oscillating: bool) -> Coroutine[Any, Any, None]

Controls the oscillation of a fan.

Parameters:

Name Type Description Default
oscillating bool

Turns oscillation on/off.

required
Source code in src/hassette/models/entities/fan.py
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
def oscillate(
    self,
    *,
    oscillating: bool,
) -> Coroutine[Any, Any, None]:
    """Controls the oscillation of a fan.

    Args:
        oscillating: Turns oscillation on/off.
    """
    return self.api.call_service(
        domain=self.domain,
        service="oscillate",
        target={"entity_id": self.entity_id},
        oscillating=oscillating,
    )

toggle() -> Coroutine[Any, Any, None]

Toggles a fan on/off.

Source code in src/hassette/models/entities/fan.py
101
102
103
104
105
106
107
def toggle(self) -> Coroutine[Any, Any, None]:
    """Toggles a fan on/off."""
    return self.api.call_service(
        domain=self.domain,
        service="toggle",
        target={"entity_id": self.entity_id},
    )

set_direction(*, direction: FanDirection) -> Coroutine[Any, Any, None]

Sets a fan's rotation direction.

Parameters:

Name Type Description Default
direction FanDirection

Direction of the fan rotation.

required
Source code in src/hassette/models/entities/fan.py
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
def set_direction(
    self,
    *,
    direction: FanDirection,
) -> Coroutine[Any, Any, None]:
    """Sets a fan's rotation direction.

    Args:
        direction: Direction of the fan rotation.
    """
    return self.api.call_service(
        domain=self.domain,
        service="set_direction",
        target={"entity_id": self.entity_id},
        direction=direction,
    )

increase_speed(*, percentage_step: int | None = None) -> Coroutine[Any, Any, None]

Increases the speed of a fan.

Parameters:

Name Type Description Default
percentage_step int | None

Percentage step by which the speed should be increased.

None
Source code in src/hassette/models/entities/fan.py
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
def increase_speed(
    self,
    *,
    percentage_step: int | None = None,
) -> Coroutine[Any, Any, None]:
    """Increases the speed of a fan.

    Args:
        percentage_step: Percentage step by which the speed should be increased.
    """
    return self.api.call_service(
        domain=self.domain,
        service="increase_speed",
        target={"entity_id": self.entity_id},
        percentage_step=percentage_step,
    )

decrease_speed(*, percentage_step: int | None = None) -> Coroutine[Any, Any, None]

Decreases the speed of a fan.

Parameters:

Name Type Description Default
percentage_step int | None

Percentage step by which the speed should be decreased.

None
Source code in src/hassette/models/entities/fan.py
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
def decrease_speed(
    self,
    *,
    percentage_step: int | None = None,
) -> Coroutine[Any, Any, None]:
    """Decreases the speed of a fan.

    Args:
        percentage_step: Percentage step by which the speed should be decreased.
    """
    return self.api.call_service(
        domain=self.domain,
        service="decrease_speed",
        target={"entity_id": self.entity_id},
        percentage_step=percentage_step,
    )

FanEntitySyncFacade

Bases: BaseEntitySyncFacade[FanState, str]

Synchronous facade for FanEntity service methods.

Source code in src/hassette/models/entities/fan.py
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
class FanEntitySyncFacade(BaseEntitySyncFacade[FanState, str]):
    """Synchronous facade for FanEntity service methods."""

    def set_preset_mode(
        self,
        *,
        preset_mode: str,
    ) -> None:
        """Sets the preset mode of a fan.

        Args:
            preset_mode: Preset fan mode.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="set_preset_mode",
            target={"entity_id": self.entity.entity_id},
            preset_mode=preset_mode,
        )

    def set_percentage(
        self,
        *,
        percentage: int,
    ) -> None:
        """Sets the speed of a fan.

        Args:
            percentage: Speed of the fan.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="set_percentage",
            target={"entity_id": self.entity.entity_id},
            percentage=percentage,
        )

    def turn_on(
        self,
        *,
        percentage: int | None = None,
        preset_mode: str | None = None,
    ) -> None:
        """Turns on a fan.

        Args:
            percentage: Speed of the fan.
            preset_mode: Preset fan mode.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="turn_on",
            target={"entity_id": self.entity.entity_id},
            percentage=percentage,
            preset_mode=preset_mode,
        )

    def turn_off(self) -> None:
        """Turns off a fan."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="turn_off",
            target={"entity_id": self.entity.entity_id},
        )

    def oscillate(
        self,
        *,
        oscillating: bool,
    ) -> None:
        """Controls the oscillation of a fan.

        Args:
            oscillating: Turns oscillation on/off.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="oscillate",
            target={"entity_id": self.entity.entity_id},
            oscillating=oscillating,
        )

    def toggle(self) -> None:
        """Toggles a fan on/off."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="toggle",
            target={"entity_id": self.entity.entity_id},
        )

    def set_direction(
        self,
        *,
        direction: FanDirection,
    ) -> None:
        """Sets a fan's rotation direction.

        Args:
            direction: Direction of the fan rotation.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="set_direction",
            target={"entity_id": self.entity.entity_id},
            direction=direction,
        )

    def increase_speed(
        self,
        *,
        percentage_step: int | None = None,
    ) -> None:
        """Increases the speed of a fan.

        Args:
            percentage_step: Percentage step by which the speed should be increased.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="increase_speed",
            target={"entity_id": self.entity.entity_id},
            percentage_step=percentage_step,
        )

    def decrease_speed(
        self,
        *,
        percentage_step: int | None = None,
    ) -> None:
        """Decreases the speed of a fan.

        Args:
            percentage_step: Percentage step by which the speed should be decreased.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="decrease_speed",
            target={"entity_id": self.entity.entity_id},
            percentage_step=percentage_step,
        )

set_preset_mode(*, preset_mode: str) -> None

Sets the preset mode of a fan.

Parameters:

Name Type Description Default
preset_mode str

Preset fan mode.

required
Source code in src/hassette/models/entities/fan.py
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
def set_preset_mode(
    self,
    *,
    preset_mode: str,
) -> None:
    """Sets the preset mode of a fan.

    Args:
        preset_mode: Preset fan mode.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="set_preset_mode",
        target={"entity_id": self.entity.entity_id},
        preset_mode=preset_mode,
    )

set_percentage(*, percentage: int) -> None

Sets the speed of a fan.

Parameters:

Name Type Description Default
percentage int

Speed of the fan.

required
Source code in src/hassette/models/entities/fan.py
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
def set_percentage(
    self,
    *,
    percentage: int,
) -> None:
    """Sets the speed of a fan.

    Args:
        percentage: Speed of the fan.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="set_percentage",
        target={"entity_id": self.entity.entity_id},
        percentage=percentage,
    )

turn_on(*, percentage: int | None = None, preset_mode: str | None = None) -> None

Turns on a fan.

Parameters:

Name Type Description Default
percentage int | None

Speed of the fan.

None
preset_mode str | None

Preset fan mode.

None
Source code in src/hassette/models/entities/fan.py
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
def turn_on(
    self,
    *,
    percentage: int | None = None,
    preset_mode: str | None = None,
) -> None:
    """Turns on a fan.

    Args:
        percentage: Speed of the fan.
        preset_mode: Preset fan mode.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="turn_on",
        target={"entity_id": self.entity.entity_id},
        percentage=percentage,
        preset_mode=preset_mode,
    )

turn_off() -> None

Turns off a fan.

Source code in src/hassette/models/entities/fan.py
218
219
220
221
222
223
224
def turn_off(self) -> None:
    """Turns off a fan."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="turn_off",
        target={"entity_id": self.entity.entity_id},
    )

oscillate(*, oscillating: bool) -> None

Controls the oscillation of a fan.

Parameters:

Name Type Description Default
oscillating bool

Turns oscillation on/off.

required
Source code in src/hassette/models/entities/fan.py
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
def oscillate(
    self,
    *,
    oscillating: bool,
) -> None:
    """Controls the oscillation of a fan.

    Args:
        oscillating: Turns oscillation on/off.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="oscillate",
        target={"entity_id": self.entity.entity_id},
        oscillating=oscillating,
    )

toggle() -> None

Toggles a fan on/off.

Source code in src/hassette/models/entities/fan.py
243
244
245
246
247
248
249
def toggle(self) -> None:
    """Toggles a fan on/off."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="toggle",
        target={"entity_id": self.entity.entity_id},
    )

set_direction(*, direction: FanDirection) -> None

Sets a fan's rotation direction.

Parameters:

Name Type Description Default
direction FanDirection

Direction of the fan rotation.

required
Source code in src/hassette/models/entities/fan.py
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
def set_direction(
    self,
    *,
    direction: FanDirection,
) -> None:
    """Sets a fan's rotation direction.

    Args:
        direction: Direction of the fan rotation.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="set_direction",
        target={"entity_id": self.entity.entity_id},
        direction=direction,
    )

increase_speed(*, percentage_step: int | None = None) -> None

Increases the speed of a fan.

Parameters:

Name Type Description Default
percentage_step int | None

Percentage step by which the speed should be increased.

None
Source code in src/hassette/models/entities/fan.py
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
def increase_speed(
    self,
    *,
    percentage_step: int | None = None,
) -> None:
    """Increases the speed of a fan.

    Args:
        percentage_step: Percentage step by which the speed should be increased.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="increase_speed",
        target={"entity_id": self.entity.entity_id},
        percentage_step=percentage_step,
    )

decrease_speed(*, percentage_step: int | None = None) -> None

Decreases the speed of a fan.

Parameters:

Name Type Description Default
percentage_step int | None

Percentage step by which the speed should be decreased.

None
Source code in src/hassette/models/entities/fan.py
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
def decrease_speed(
    self,
    *,
    percentage_step: int | None = None,
) -> None:
    """Decreases the speed of a fan.

    Args:
        percentage_step: Percentage step by which the speed should be decreased.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="decrease_speed",
        target={"entity_id": self.entity.entity_id},
        percentage_step=percentage_step,
    )

HumidifierEntity

Bases: BaseEntity[HumidifierState, str]

Source code in src/hassette/models/entities/humidifier.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
class HumidifierEntity(BaseEntity[HumidifierState, str]):
    @property
    def attributes(self) -> HumidifierAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "HumidifierEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(HumidifierEntitySyncFacade)

    def set_mode(
        self,
        *,
        mode: str,
    ) -> Coroutine[Any, Any, None]:
        """Sets the mode of a humidifier.

        Args:
            mode: Operation mode. For example, "normal", "eco", or "away". For a list of possible values, refer to the
                integration documentation.
        """
        return self.api.call_service(
            domain=self.domain,
            service="set_mode",
            target={"entity_id": self.entity_id},
            mode=mode,
        )

    def set_humidity(
        self,
        *,
        humidity: int,
    ) -> Coroutine[Any, Any, None]:
        """Sets the target humidity of a humidifier.

        Args:
            humidity: Target humidity.
        """
        return self.api.call_service(
            domain=self.domain,
            service="set_humidity",
            target={"entity_id": self.entity_id},
            humidity=humidity,
        )

    def turn_on(self) -> Coroutine[Any, Any, None]:
        """Turns on a humidifier."""
        return self.api.call_service(
            domain=self.domain,
            service="turn_on",
            target={"entity_id": self.entity_id},
        )

    def turn_off(self) -> Coroutine[Any, Any, None]:
        """Turns off a humidifier."""
        return self.api.call_service(
            domain=self.domain,
            service="turn_off",
            target={"entity_id": self.entity_id},
        )

    def toggle(self) -> Coroutine[Any, Any, None]:
        """Toggles a humidifier on/off."""
        return self.api.call_service(
            domain=self.domain,
            service="toggle",
            target={"entity_id": self.entity_id},
        )

sync: HumidifierEntitySyncFacade property

Return the typed synchronous facade for this entity.

set_mode(*, mode: str) -> Coroutine[Any, Any, None]

Sets the mode of a humidifier.

Parameters:

Name Type Description Default
mode str

Operation mode. For example, "normal", "eco", or "away". For a list of possible values, refer to the integration documentation.

required
Source code in src/hassette/models/entities/humidifier.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
def set_mode(
    self,
    *,
    mode: str,
) -> Coroutine[Any, Any, None]:
    """Sets the mode of a humidifier.

    Args:
        mode: Operation mode. For example, "normal", "eco", or "away". For a list of possible values, refer to the
            integration documentation.
    """
    return self.api.call_service(
        domain=self.domain,
        service="set_mode",
        target={"entity_id": self.entity_id},
        mode=mode,
    )

set_humidity(*, humidity: int) -> Coroutine[Any, Any, None]

Sets the target humidity of a humidifier.

Parameters:

Name Type Description Default
humidity int

Target humidity.

required
Source code in src/hassette/models/entities/humidifier.py
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
def set_humidity(
    self,
    *,
    humidity: int,
) -> Coroutine[Any, Any, None]:
    """Sets the target humidity of a humidifier.

    Args:
        humidity: Target humidity.
    """
    return self.api.call_service(
        domain=self.domain,
        service="set_humidity",
        target={"entity_id": self.entity_id},
        humidity=humidity,
    )

turn_on() -> Coroutine[Any, Any, None]

Turns on a humidifier.

Source code in src/hassette/models/entities/humidifier.py
55
56
57
58
59
60
61
def turn_on(self) -> Coroutine[Any, Any, None]:
    """Turns on a humidifier."""
    return self.api.call_service(
        domain=self.domain,
        service="turn_on",
        target={"entity_id": self.entity_id},
    )

turn_off() -> Coroutine[Any, Any, None]

Turns off a humidifier.

Source code in src/hassette/models/entities/humidifier.py
63
64
65
66
67
68
69
def turn_off(self) -> Coroutine[Any, Any, None]:
    """Turns off a humidifier."""
    return self.api.call_service(
        domain=self.domain,
        service="turn_off",
        target={"entity_id": self.entity_id},
    )

toggle() -> Coroutine[Any, Any, None]

Toggles a humidifier on/off.

Source code in src/hassette/models/entities/humidifier.py
71
72
73
74
75
76
77
def toggle(self) -> Coroutine[Any, Any, None]:
    """Toggles a humidifier on/off."""
    return self.api.call_service(
        domain=self.domain,
        service="toggle",
        target={"entity_id": self.entity_id},
    )

HumidifierEntitySyncFacade

Bases: BaseEntitySyncFacade[HumidifierState, str]

Synchronous facade for HumidifierEntity service methods.

Source code in src/hassette/models/entities/humidifier.py
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
class HumidifierEntitySyncFacade(BaseEntitySyncFacade[HumidifierState, str]):
    """Synchronous facade for HumidifierEntity service methods."""

    def set_mode(
        self,
        *,
        mode: str,
    ) -> None:
        """Sets the mode of a humidifier.

        Args:
            mode: Operation mode. For example, "normal", "eco", or "away". For a list of possible values, refer to the
                integration documentation.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="set_mode",
            target={"entity_id": self.entity.entity_id},
            mode=mode,
        )

    def set_humidity(
        self,
        *,
        humidity: int,
    ) -> None:
        """Sets the target humidity of a humidifier.

        Args:
            humidity: Target humidity.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="set_humidity",
            target={"entity_id": self.entity.entity_id},
            humidity=humidity,
        )

    def turn_on(self) -> None:
        """Turns on a humidifier."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="turn_on",
            target={"entity_id": self.entity.entity_id},
        )

    def turn_off(self) -> None:
        """Turns off a humidifier."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="turn_off",
            target={"entity_id": self.entity.entity_id},
        )

    def toggle(self) -> None:
        """Toggles a humidifier on/off."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="toggle",
            target={"entity_id": self.entity.entity_id},
        )

set_mode(*, mode: str) -> None

Sets the mode of a humidifier.

Parameters:

Name Type Description Default
mode str

Operation mode. For example, "normal", "eco", or "away". For a list of possible values, refer to the integration documentation.

required
Source code in src/hassette/models/entities/humidifier.py
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
def set_mode(
    self,
    *,
    mode: str,
) -> None:
    """Sets the mode of a humidifier.

    Args:
        mode: Operation mode. For example, "normal", "eco", or "away". For a list of possible values, refer to the
            integration documentation.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="set_mode",
        target={"entity_id": self.entity.entity_id},
        mode=mode,
    )

set_humidity(*, humidity: int) -> None

Sets the target humidity of a humidifier.

Parameters:

Name Type Description Default
humidity int

Target humidity.

required
Source code in src/hassette/models/entities/humidifier.py
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
def set_humidity(
    self,
    *,
    humidity: int,
) -> None:
    """Sets the target humidity of a humidifier.

    Args:
        humidity: Target humidity.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="set_humidity",
        target={"entity_id": self.entity.entity_id},
        humidity=humidity,
    )

turn_on() -> None

Turns on a humidifier.

Source code in src/hassette/models/entities/humidifier.py
118
119
120
121
122
123
124
def turn_on(self) -> None:
    """Turns on a humidifier."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="turn_on",
        target={"entity_id": self.entity.entity_id},
    )

turn_off() -> None

Turns off a humidifier.

Source code in src/hassette/models/entities/humidifier.py
126
127
128
129
130
131
132
def turn_off(self) -> None:
    """Turns off a humidifier."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="turn_off",
        target={"entity_id": self.entity.entity_id},
    )

toggle() -> None

Toggles a humidifier on/off.

Source code in src/hassette/models/entities/humidifier.py
134
135
136
137
138
139
140
def toggle(self) -> None:
    """Toggles a humidifier on/off."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="toggle",
        target={"entity_id": self.entity.entity_id},
    )

ImageEntity

Bases: BaseEntity[ImageState, str]

Source code in src/hassette/models/entities/image.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
class ImageEntity(BaseEntity[ImageState, str]):
    @property
    def attributes(self) -> ImageAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "ImageEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(ImageEntitySyncFacade)

    def snapshot(
        self,
        *,
        filename: str,
    ) -> Coroutine[Any, Any, None]:
        """Takes a snapshot from an image.

        Args:
            filename: Template of a filename. Variable available is `entity_id`.
        """
        return self.api.call_service(
            domain=self.domain,
            service="snapshot",
            target={"entity_id": self.entity_id},
            filename=filename,
        )

sync: ImageEntitySyncFacade property

Return the typed synchronous facade for this entity.

snapshot(*, filename: str) -> Coroutine[Any, Any, None]

Takes a snapshot from an image.

Parameters:

Name Type Description Default
filename str

Template of a filename. Variable available is entity_id.

required
Source code in src/hassette/models/entities/image.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
def snapshot(
    self,
    *,
    filename: str,
) -> Coroutine[Any, Any, None]:
    """Takes a snapshot from an image.

    Args:
        filename: Template of a filename. Variable available is `entity_id`.
    """
    return self.api.call_service(
        domain=self.domain,
        service="snapshot",
        target={"entity_id": self.entity_id},
        filename=filename,
    )

ImageEntitySyncFacade

Bases: BaseEntitySyncFacade[ImageState, str]

Synchronous facade for ImageEntity service methods.

Source code in src/hassette/models/entities/image.py
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
class ImageEntitySyncFacade(BaseEntitySyncFacade[ImageState, str]):
    """Synchronous facade for ImageEntity service methods."""

    def snapshot(
        self,
        *,
        filename: str,
    ) -> None:
        """Takes a snapshot from an image.

        Args:
            filename: Template of a filename. Variable available is `entity_id`.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="snapshot",
            target={"entity_id": self.entity.entity_id},
            filename=filename,
        )

snapshot(*, filename: str) -> None

Takes a snapshot from an image.

Parameters:

Name Type Description Default
filename str

Template of a filename. Variable available is entity_id.

required
Source code in src/hassette/models/entities/image.py
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
def snapshot(
    self,
    *,
    filename: str,
) -> None:
    """Takes a snapshot from an image.

    Args:
        filename: Template of a filename. Variable available is `entity_id`.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="snapshot",
        target={"entity_id": self.entity.entity_id},
        filename=filename,
    )

LawnMowerEntity

Bases: BaseEntity[LawnMowerState, str]

Source code in src/hassette/models/entities/lawn_mower.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
class LawnMowerEntity(BaseEntity[LawnMowerState, str]):
    @property
    def attributes(self) -> LawnMowerAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "LawnMowerEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(LawnMowerEntitySyncFacade)

    def start_mowing(self) -> Coroutine[Any, Any, None]:
        """Starts a lawn mower's mowing task."""
        return self.api.call_service(
            domain=self.domain,
            service="start_mowing",
            target={"entity_id": self.entity_id},
        )

    def dock(self) -> Coroutine[Any, Any, None]:
        """Returns a lawn mower to its dock."""
        return self.api.call_service(
            domain=self.domain,
            service="dock",
            target={"entity_id": self.entity_id},
        )

    def pause(self) -> Coroutine[Any, Any, None]:
        """Pauses a lawn mower's current task."""
        return self.api.call_service(
            domain=self.domain,
            service="pause",
            target={"entity_id": self.entity_id},
        )

sync: LawnMowerEntitySyncFacade property

Return the typed synchronous facade for this entity.

start_mowing() -> Coroutine[Any, Any, None]

Starts a lawn mower's mowing task.

Source code in src/hassette/models/entities/lawn_mower.py
20
21
22
23
24
25
26
def start_mowing(self) -> Coroutine[Any, Any, None]:
    """Starts a lawn mower's mowing task."""
    return self.api.call_service(
        domain=self.domain,
        service="start_mowing",
        target={"entity_id": self.entity_id},
    )

dock() -> Coroutine[Any, Any, None]

Returns a lawn mower to its dock.

Source code in src/hassette/models/entities/lawn_mower.py
28
29
30
31
32
33
34
def dock(self) -> Coroutine[Any, Any, None]:
    """Returns a lawn mower to its dock."""
    return self.api.call_service(
        domain=self.domain,
        service="dock",
        target={"entity_id": self.entity_id},
    )

pause() -> Coroutine[Any, Any, None]

Pauses a lawn mower's current task.

Source code in src/hassette/models/entities/lawn_mower.py
36
37
38
39
40
41
42
def pause(self) -> Coroutine[Any, Any, None]:
    """Pauses a lawn mower's current task."""
    return self.api.call_service(
        domain=self.domain,
        service="pause",
        target={"entity_id": self.entity_id},
    )

LawnMowerEntitySyncFacade

Bases: BaseEntitySyncFacade[LawnMowerState, str]

Synchronous facade for LawnMowerEntity service methods.

Source code in src/hassette/models/entities/lawn_mower.py
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
class LawnMowerEntitySyncFacade(BaseEntitySyncFacade[LawnMowerState, str]):
    """Synchronous facade for LawnMowerEntity service methods."""

    def start_mowing(self) -> None:
        """Starts a lawn mower's mowing task."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="start_mowing",
            target={"entity_id": self.entity.entity_id},
        )

    def dock(self) -> None:
        """Returns a lawn mower to its dock."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="dock",
            target={"entity_id": self.entity.entity_id},
        )

    def pause(self) -> None:
        """Pauses a lawn mower's current task."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="pause",
            target={"entity_id": self.entity.entity_id},
        )

start_mowing() -> None

Starts a lawn mower's mowing task.

Source code in src/hassette/models/entities/lawn_mower.py
48
49
50
51
52
53
54
def start_mowing(self) -> None:
    """Starts a lawn mower's mowing task."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="start_mowing",
        target={"entity_id": self.entity.entity_id},
    )

dock() -> None

Returns a lawn mower to its dock.

Source code in src/hassette/models/entities/lawn_mower.py
56
57
58
59
60
61
62
def dock(self) -> None:
    """Returns a lawn mower to its dock."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="dock",
        target={"entity_id": self.entity.entity_id},
    )

pause() -> None

Pauses a lawn mower's current task.

Source code in src/hassette/models/entities/lawn_mower.py
64
65
66
67
68
69
70
def pause(self) -> None:
    """Pauses a lawn mower's current task."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="pause",
        target={"entity_id": self.entity.entity_id},
    )

LightEntity

Bases: BaseEntity[LightState, str]

Source code in src/hassette/models/entities/light.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
class LightEntity(BaseEntity[LightState, str]):
    @property
    def attributes(self) -> LightAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "LightEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(LightEntitySyncFacade)

    def turn_on(
        self,
        *,
        brightness: int | None = None,
        brightness_pct: int | None = None,
        brightness_step: int | None = None,
        brightness_step_pct: int | None = None,
        color_name: Color | None = None,
        color_temp_kelvin: int | None = None,
        effect: str | None = None,
        flash: LightFlash | None = None,
        hs_color: tuple[float, float] | None = None,
        profile: str | None = None,
        rgb_color: tuple[int, int, int] | None = None,
        rgbw_color: tuple[int, int, int, int] | None = None,
        rgbww_color: tuple[int, int, int, int, int] | None = None,
        transition: int | None = None,
        white: int | None = None,
        xy_color: tuple[float, float] | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Turns on one or more lights and adjusts their properties, even when they are turned on already.

        Args:
            brightness: Number indicating brightness, where 0 turns the light off, 1 is the minimum brightness, and 255
                is the maximum brightness.
            brightness_pct: Number indicating the percentage of full brightness, where 0 turns the light off, 1 is the
                minimum brightness, and 100 is the maximum brightness.
            brightness_step: Change brightness by an amount.
            brightness_step_pct: Change brightness by a percentage.
            color_name: A human-readable color name.
            color_temp_kelvin: Color temperature in Kelvin.
            effect: Light effect.
            flash: Tell light to flash, can be either value short or long.
            hs_color: Color in hue/sat format. A list of two integers. Hue is 0-360 and Sat is 0-100.
            profile: Name of a light profile to use.
            rgb_color: The color in RGB format. A list of three integers between 0 and 255 representing the values of
                red, green, and blue.
            rgbw_color: The color in RGBW format. A list of four integers between 0 and 255 representing the values of
                red, green, blue, and white.
            rgbww_color: The color in RGBWW format. A list of five integers between 0 and 255 representing the values of
                red, green, blue, cold white, and warm white.
            transition: Duration it takes to get to next state.
            white: Set the light to white mode.
            xy_color: Color in XY-format. A list of two decimal numbers between 0 and 1.
        """
        return self.api.call_service(
            domain=self.domain,
            service="turn_on",
            target={"entity_id": self.entity_id},
            brightness=brightness,
            brightness_pct=brightness_pct,
            brightness_step=brightness_step,
            brightness_step_pct=brightness_step_pct,
            color_name=color_name,
            color_temp_kelvin=color_temp_kelvin,
            effect=effect,
            flash=flash,
            hs_color=hs_color,
            profile=profile,
            rgb_color=rgb_color,
            rgbw_color=rgbw_color,
            rgbww_color=rgbww_color,
            transition=transition,
            white=white,
            xy_color=xy_color,
        )

    def turn_off(
        self,
        *,
        flash: LightFlash | None = None,
        transition: int | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Turns off one or more lights.

        Args:
            flash: Tell light to flash, can be either value short or long.
            transition: Duration it takes to get to next state.
        """
        return self.api.call_service(
            domain=self.domain,
            service="turn_off",
            target={"entity_id": self.entity_id},
            flash=flash,
            transition=transition,
        )

    def toggle(
        self,
        *,
        brightness: int | None = None,
        brightness_pct: int | None = None,
        color_name: Color | None = None,
        color_temp_kelvin: int | None = None,
        effect: str | None = None,
        flash: LightFlash | None = None,
        hs_color: tuple[float, float] | None = None,
        profile: str | None = None,
        rgb_color: tuple[int, int, int] | None = None,
        rgbw_color: tuple[int, int, int, int] | None = None,
        rgbww_color: tuple[int, int, int, int, int] | None = None,
        transition: int | None = None,
        white: int | None = None,
        xy_color: tuple[float, float] | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Toggles one or more lights, from on to off, or off to on, based on their current state.

        Args:
            brightness: Number indicating brightness, where 0 turns the light off, 1 is the minimum brightness, and 255
                is the maximum brightness.
            brightness_pct: Number indicating the percentage of full brightness, where 0 turns the light off, 1 is the
                minimum brightness, and 100 is the maximum brightness.
            color_name: A human-readable color name.
            color_temp_kelvin: Color temperature in Kelvin.
            effect: Light effect.
            flash: Tell light to flash, can be either value short or long.
            hs_color: Color in hue/sat format. A list of two integers. Hue is 0-360 and Sat is 0-100.
            profile: Name of a light profile to use.
            rgb_color: The color in RGB format. A list of three integers between 0 and 255 representing the values of
                red, green, and blue.
            rgbw_color: The color in RGBW format. A list of four integers between 0 and 255 representing the values of
                red, green, blue, and white.
            rgbww_color: The color in RGBWW format. A list of five integers between 0 and 255 representing the values of
                red, green, blue, cold white, and warm white.
            transition: Duration it takes to get to next state.
            white: Set the light to white mode.
            xy_color: Color in XY-format. A list of two decimal numbers between 0 and 1.
        """
        return self.api.call_service(
            domain=self.domain,
            service="toggle",
            target={"entity_id": self.entity_id},
            brightness=brightness,
            brightness_pct=brightness_pct,
            color_name=color_name,
            color_temp_kelvin=color_temp_kelvin,
            effect=effect,
            flash=flash,
            hs_color=hs_color,
            profile=profile,
            rgb_color=rgb_color,
            rgbw_color=rgbw_color,
            rgbww_color=rgbww_color,
            transition=transition,
            white=white,
            xy_color=xy_color,
        )

sync: LightEntitySyncFacade property

Return the typed synchronous facade for this entity.

turn_on(*, brightness: int | None = None, brightness_pct: int | None = None, brightness_step: int | None = None, brightness_step_pct: int | None = None, color_name: Color | None = None, color_temp_kelvin: int | None = None, effect: str | None = None, flash: LightFlash | None = None, hs_color: tuple[float, float] | None = None, profile: str | None = None, rgb_color: tuple[int, int, int] | None = None, rgbw_color: tuple[int, int, int, int] | None = None, rgbww_color: tuple[int, int, int, int, int] | None = None, transition: int | None = None, white: int | None = None, xy_color: tuple[float, float] | None = None) -> Coroutine[Any, Any, None]

Turns on one or more lights and adjusts their properties, even when they are turned on already.

Parameters:

Name Type Description Default
brightness int | None

Number indicating brightness, where 0 turns the light off, 1 is the minimum brightness, and 255 is the maximum brightness.

None
brightness_pct int | None

Number indicating the percentage of full brightness, where 0 turns the light off, 1 is the minimum brightness, and 100 is the maximum brightness.

None
brightness_step int | None

Change brightness by an amount.

None
brightness_step_pct int | None

Change brightness by a percentage.

None
color_name Color | None

A human-readable color name.

None
color_temp_kelvin int | None

Color temperature in Kelvin.

None
effect str | None

Light effect.

None
flash LightFlash | None

Tell light to flash, can be either value short or long.

None
hs_color tuple[float, float] | None

Color in hue/sat format. A list of two integers. Hue is 0-360 and Sat is 0-100.

None
profile str | None

Name of a light profile to use.

None
rgb_color tuple[int, int, int] | None

The color in RGB format. A list of three integers between 0 and 255 representing the values of red, green, and blue.

None
rgbw_color tuple[int, int, int, int] | None

The color in RGBW format. A list of four integers between 0 and 255 representing the values of red, green, blue, and white.

None
rgbww_color tuple[int, int, int, int, int] | None

The color in RGBWW format. A list of five integers between 0 and 255 representing the values of red, green, blue, cold white, and warm white.

None
transition int | None

Duration it takes to get to next state.

None
white int | None

Set the light to white mode.

None
xy_color tuple[float, float] | None

Color in XY-format. A list of two decimal numbers between 0 and 1.

None
Source code in src/hassette/models/entities/light.py
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
def turn_on(
    self,
    *,
    brightness: int | None = None,
    brightness_pct: int | None = None,
    brightness_step: int | None = None,
    brightness_step_pct: int | None = None,
    color_name: Color | None = None,
    color_temp_kelvin: int | None = None,
    effect: str | None = None,
    flash: LightFlash | None = None,
    hs_color: tuple[float, float] | None = None,
    profile: str | None = None,
    rgb_color: tuple[int, int, int] | None = None,
    rgbw_color: tuple[int, int, int, int] | None = None,
    rgbww_color: tuple[int, int, int, int, int] | None = None,
    transition: int | None = None,
    white: int | None = None,
    xy_color: tuple[float, float] | None = None,
) -> Coroutine[Any, Any, None]:
    """Turns on one or more lights and adjusts their properties, even when they are turned on already.

    Args:
        brightness: Number indicating brightness, where 0 turns the light off, 1 is the minimum brightness, and 255
            is the maximum brightness.
        brightness_pct: Number indicating the percentage of full brightness, where 0 turns the light off, 1 is the
            minimum brightness, and 100 is the maximum brightness.
        brightness_step: Change brightness by an amount.
        brightness_step_pct: Change brightness by a percentage.
        color_name: A human-readable color name.
        color_temp_kelvin: Color temperature in Kelvin.
        effect: Light effect.
        flash: Tell light to flash, can be either value short or long.
        hs_color: Color in hue/sat format. A list of two integers. Hue is 0-360 and Sat is 0-100.
        profile: Name of a light profile to use.
        rgb_color: The color in RGB format. A list of three integers between 0 and 255 representing the values of
            red, green, and blue.
        rgbw_color: The color in RGBW format. A list of four integers between 0 and 255 representing the values of
            red, green, blue, and white.
        rgbww_color: The color in RGBWW format. A list of five integers between 0 and 255 representing the values of
            red, green, blue, cold white, and warm white.
        transition: Duration it takes to get to next state.
        white: Set the light to white mode.
        xy_color: Color in XY-format. A list of two decimal numbers between 0 and 1.
    """
    return self.api.call_service(
        domain=self.domain,
        service="turn_on",
        target={"entity_id": self.entity_id},
        brightness=brightness,
        brightness_pct=brightness_pct,
        brightness_step=brightness_step,
        brightness_step_pct=brightness_step_pct,
        color_name=color_name,
        color_temp_kelvin=color_temp_kelvin,
        effect=effect,
        flash=flash,
        hs_color=hs_color,
        profile=profile,
        rgb_color=rgb_color,
        rgbw_color=rgbw_color,
        rgbww_color=rgbww_color,
        transition=transition,
        white=white,
        xy_color=xy_color,
    )

turn_off(*, flash: LightFlash | None = None, transition: int | None = None) -> Coroutine[Any, Any, None]

Turns off one or more lights.

Parameters:

Name Type Description Default
flash LightFlash | None

Tell light to flash, can be either value short or long.

None
transition int | None

Duration it takes to get to next state.

None
Source code in src/hassette/models/entities/light.py
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
def turn_off(
    self,
    *,
    flash: LightFlash | None = None,
    transition: int | None = None,
) -> Coroutine[Any, Any, None]:
    """Turns off one or more lights.

    Args:
        flash: Tell light to flash, can be either value short or long.
        transition: Duration it takes to get to next state.
    """
    return self.api.call_service(
        domain=self.domain,
        service="turn_off",
        target={"entity_id": self.entity_id},
        flash=flash,
        transition=transition,
    )

toggle(*, brightness: int | None = None, brightness_pct: int | None = None, color_name: Color | None = None, color_temp_kelvin: int | None = None, effect: str | None = None, flash: LightFlash | None = None, hs_color: tuple[float, float] | None = None, profile: str | None = None, rgb_color: tuple[int, int, int] | None = None, rgbw_color: tuple[int, int, int, int] | None = None, rgbww_color: tuple[int, int, int, int, int] | None = None, transition: int | None = None, white: int | None = None, xy_color: tuple[float, float] | None = None) -> Coroutine[Any, Any, None]

Toggles one or more lights, from on to off, or off to on, based on their current state.

Parameters:

Name Type Description Default
brightness int | None

Number indicating brightness, where 0 turns the light off, 1 is the minimum brightness, and 255 is the maximum brightness.

None
brightness_pct int | None

Number indicating the percentage of full brightness, where 0 turns the light off, 1 is the minimum brightness, and 100 is the maximum brightness.

None
color_name Color | None

A human-readable color name.

None
color_temp_kelvin int | None

Color temperature in Kelvin.

None
effect str | None

Light effect.

None
flash LightFlash | None

Tell light to flash, can be either value short or long.

None
hs_color tuple[float, float] | None

Color in hue/sat format. A list of two integers. Hue is 0-360 and Sat is 0-100.

None
profile str | None

Name of a light profile to use.

None
rgb_color tuple[int, int, int] | None

The color in RGB format. A list of three integers between 0 and 255 representing the values of red, green, and blue.

None
rgbw_color tuple[int, int, int, int] | None

The color in RGBW format. A list of four integers between 0 and 255 representing the values of red, green, blue, and white.

None
rgbww_color tuple[int, int, int, int, int] | None

The color in RGBWW format. A list of five integers between 0 and 255 representing the values of red, green, blue, cold white, and warm white.

None
transition int | None

Duration it takes to get to next state.

None
white int | None

Set the light to white mode.

None
xy_color tuple[float, float] | None

Color in XY-format. A list of two decimal numbers between 0 and 1.

None
Source code in src/hassette/models/entities/light.py
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
def toggle(
    self,
    *,
    brightness: int | None = None,
    brightness_pct: int | None = None,
    color_name: Color | None = None,
    color_temp_kelvin: int | None = None,
    effect: str | None = None,
    flash: LightFlash | None = None,
    hs_color: tuple[float, float] | None = None,
    profile: str | None = None,
    rgb_color: tuple[int, int, int] | None = None,
    rgbw_color: tuple[int, int, int, int] | None = None,
    rgbww_color: tuple[int, int, int, int, int] | None = None,
    transition: int | None = None,
    white: int | None = None,
    xy_color: tuple[float, float] | None = None,
) -> Coroutine[Any, Any, None]:
    """Toggles one or more lights, from on to off, or off to on, based on their current state.

    Args:
        brightness: Number indicating brightness, where 0 turns the light off, 1 is the minimum brightness, and 255
            is the maximum brightness.
        brightness_pct: Number indicating the percentage of full brightness, where 0 turns the light off, 1 is the
            minimum brightness, and 100 is the maximum brightness.
        color_name: A human-readable color name.
        color_temp_kelvin: Color temperature in Kelvin.
        effect: Light effect.
        flash: Tell light to flash, can be either value short or long.
        hs_color: Color in hue/sat format. A list of two integers. Hue is 0-360 and Sat is 0-100.
        profile: Name of a light profile to use.
        rgb_color: The color in RGB format. A list of three integers between 0 and 255 representing the values of
            red, green, and blue.
        rgbw_color: The color in RGBW format. A list of four integers between 0 and 255 representing the values of
            red, green, blue, and white.
        rgbww_color: The color in RGBWW format. A list of five integers between 0 and 255 representing the values of
            red, green, blue, cold white, and warm white.
        transition: Duration it takes to get to next state.
        white: Set the light to white mode.
        xy_color: Color in XY-format. A list of two decimal numbers between 0 and 1.
    """
    return self.api.call_service(
        domain=self.domain,
        service="toggle",
        target={"entity_id": self.entity_id},
        brightness=brightness,
        brightness_pct=brightness_pct,
        color_name=color_name,
        color_temp_kelvin=color_temp_kelvin,
        effect=effect,
        flash=flash,
        hs_color=hs_color,
        profile=profile,
        rgb_color=rgb_color,
        rgbw_color=rgbw_color,
        rgbww_color=rgbww_color,
        transition=transition,
        white=white,
        xy_color=xy_color,
    )

LightEntitySyncFacade

Bases: BaseEntitySyncFacade[LightState, str]

Synchronous facade for LightEntity service methods.

Source code in src/hassette/models/entities/light.py
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
class LightEntitySyncFacade(BaseEntitySyncFacade[LightState, str]):
    """Synchronous facade for LightEntity service methods."""

    def turn_on(
        self,
        *,
        brightness: int | None = None,
        brightness_pct: int | None = None,
        brightness_step: int | None = None,
        brightness_step_pct: int | None = None,
        color_name: Color | None = None,
        color_temp_kelvin: int | None = None,
        effect: str | None = None,
        flash: LightFlash | None = None,
        hs_color: tuple[float, float] | None = None,
        profile: str | None = None,
        rgb_color: tuple[int, int, int] | None = None,
        rgbw_color: tuple[int, int, int, int] | None = None,
        rgbww_color: tuple[int, int, int, int, int] | None = None,
        transition: int | None = None,
        white: int | None = None,
        xy_color: tuple[float, float] | None = None,
    ) -> None:
        """Turns on one or more lights and adjusts their properties, even when they are turned on already.

        Args:
            brightness: Number indicating brightness, where 0 turns the light off, 1 is the minimum brightness, and 255
                is the maximum brightness.
            brightness_pct: Number indicating the percentage of full brightness, where 0 turns the light off, 1 is the
                minimum brightness, and 100 is the maximum brightness.
            brightness_step: Change brightness by an amount.
            brightness_step_pct: Change brightness by a percentage.
            color_name: A human-readable color name.
            color_temp_kelvin: Color temperature in Kelvin.
            effect: Light effect.
            flash: Tell light to flash, can be either value short or long.
            hs_color: Color in hue/sat format. A list of two integers. Hue is 0-360 and Sat is 0-100.
            profile: Name of a light profile to use.
            rgb_color: The color in RGB format. A list of three integers between 0 and 255 representing the values of
                red, green, and blue.
            rgbw_color: The color in RGBW format. A list of four integers between 0 and 255 representing the values of
                red, green, blue, and white.
            rgbww_color: The color in RGBWW format. A list of five integers between 0 and 255 representing the values of
                red, green, blue, cold white, and warm white.
            transition: Duration it takes to get to next state.
            white: Set the light to white mode.
            xy_color: Color in XY-format. A list of two decimal numbers between 0 and 1.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="turn_on",
            target={"entity_id": self.entity.entity_id},
            brightness=brightness,
            brightness_pct=brightness_pct,
            brightness_step=brightness_step,
            brightness_step_pct=brightness_step_pct,
            color_name=color_name,
            color_temp_kelvin=color_temp_kelvin,
            effect=effect,
            flash=flash,
            hs_color=hs_color,
            profile=profile,
            rgb_color=rgb_color,
            rgbw_color=rgbw_color,
            rgbww_color=rgbww_color,
            transition=transition,
            white=white,
            xy_color=xy_color,
        )

    def turn_off(
        self,
        *,
        flash: LightFlash | None = None,
        transition: int | None = None,
    ) -> None:
        """Turns off one or more lights.

        Args:
            flash: Tell light to flash, can be either value short or long.
            transition: Duration it takes to get to next state.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="turn_off",
            target={"entity_id": self.entity.entity_id},
            flash=flash,
            transition=transition,
        )

    def toggle(
        self,
        *,
        brightness: int | None = None,
        brightness_pct: int | None = None,
        color_name: Color | None = None,
        color_temp_kelvin: int | None = None,
        effect: str | None = None,
        flash: LightFlash | None = None,
        hs_color: tuple[float, float] | None = None,
        profile: str | None = None,
        rgb_color: tuple[int, int, int] | None = None,
        rgbw_color: tuple[int, int, int, int] | None = None,
        rgbww_color: tuple[int, int, int, int, int] | None = None,
        transition: int | None = None,
        white: int | None = None,
        xy_color: tuple[float, float] | None = None,
    ) -> None:
        """Toggles one or more lights, from on to off, or off to on, based on their current state.

        Args:
            brightness: Number indicating brightness, where 0 turns the light off, 1 is the minimum brightness, and 255
                is the maximum brightness.
            brightness_pct: Number indicating the percentage of full brightness, where 0 turns the light off, 1 is the
                minimum brightness, and 100 is the maximum brightness.
            color_name: A human-readable color name.
            color_temp_kelvin: Color temperature in Kelvin.
            effect: Light effect.
            flash: Tell light to flash, can be either value short or long.
            hs_color: Color in hue/sat format. A list of two integers. Hue is 0-360 and Sat is 0-100.
            profile: Name of a light profile to use.
            rgb_color: The color in RGB format. A list of three integers between 0 and 255 representing the values of
                red, green, and blue.
            rgbw_color: The color in RGBW format. A list of four integers between 0 and 255 representing the values of
                red, green, blue, and white.
            rgbww_color: The color in RGBWW format. A list of five integers between 0 and 255 representing the values of
                red, green, blue, cold white, and warm white.
            transition: Duration it takes to get to next state.
            white: Set the light to white mode.
            xy_color: Color in XY-format. A list of two decimal numbers between 0 and 1.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="toggle",
            target={"entity_id": self.entity.entity_id},
            brightness=brightness,
            brightness_pct=brightness_pct,
            color_name=color_name,
            color_temp_kelvin=color_temp_kelvin,
            effect=effect,
            flash=flash,
            hs_color=hs_color,
            profile=profile,
            rgb_color=rgb_color,
            rgbw_color=rgbw_color,
            rgbww_color=rgbww_color,
            transition=transition,
            white=white,
            xy_color=xy_color,
        )

turn_on(*, brightness: int | None = None, brightness_pct: int | None = None, brightness_step: int | None = None, brightness_step_pct: int | None = None, color_name: Color | None = None, color_temp_kelvin: int | None = None, effect: str | None = None, flash: LightFlash | None = None, hs_color: tuple[float, float] | None = None, profile: str | None = None, rgb_color: tuple[int, int, int] | None = None, rgbw_color: tuple[int, int, int, int] | None = None, rgbww_color: tuple[int, int, int, int, int] | None = None, transition: int | None = None, white: int | None = None, xy_color: tuple[float, float] | None = None) -> None

Turns on one or more lights and adjusts their properties, even when they are turned on already.

Parameters:

Name Type Description Default
brightness int | None

Number indicating brightness, where 0 turns the light off, 1 is the minimum brightness, and 255 is the maximum brightness.

None
brightness_pct int | None

Number indicating the percentage of full brightness, where 0 turns the light off, 1 is the minimum brightness, and 100 is the maximum brightness.

None
brightness_step int | None

Change brightness by an amount.

None
brightness_step_pct int | None

Change brightness by a percentage.

None
color_name Color | None

A human-readable color name.

None
color_temp_kelvin int | None

Color temperature in Kelvin.

None
effect str | None

Light effect.

None
flash LightFlash | None

Tell light to flash, can be either value short or long.

None
hs_color tuple[float, float] | None

Color in hue/sat format. A list of two integers. Hue is 0-360 and Sat is 0-100.

None
profile str | None

Name of a light profile to use.

None
rgb_color tuple[int, int, int] | None

The color in RGB format. A list of three integers between 0 and 255 representing the values of red, green, and blue.

None
rgbw_color tuple[int, int, int, int] | None

The color in RGBW format. A list of four integers between 0 and 255 representing the values of red, green, blue, and white.

None
rgbww_color tuple[int, int, int, int, int] | None

The color in RGBWW format. A list of five integers between 0 and 255 representing the values of red, green, blue, cold white, and warm white.

None
transition int | None

Duration it takes to get to next state.

None
white int | None

Set the light to white mode.

None
xy_color tuple[float, float] | None

Color in XY-format. A list of two decimal numbers between 0 and 1.

None
Source code in src/hassette/models/entities/light.py
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
def turn_on(
    self,
    *,
    brightness: int | None = None,
    brightness_pct: int | None = None,
    brightness_step: int | None = None,
    brightness_step_pct: int | None = None,
    color_name: Color | None = None,
    color_temp_kelvin: int | None = None,
    effect: str | None = None,
    flash: LightFlash | None = None,
    hs_color: tuple[float, float] | None = None,
    profile: str | None = None,
    rgb_color: tuple[int, int, int] | None = None,
    rgbw_color: tuple[int, int, int, int] | None = None,
    rgbww_color: tuple[int, int, int, int, int] | None = None,
    transition: int | None = None,
    white: int | None = None,
    xy_color: tuple[float, float] | None = None,
) -> None:
    """Turns on one or more lights and adjusts their properties, even when they are turned on already.

    Args:
        brightness: Number indicating brightness, where 0 turns the light off, 1 is the minimum brightness, and 255
            is the maximum brightness.
        brightness_pct: Number indicating the percentage of full brightness, where 0 turns the light off, 1 is the
            minimum brightness, and 100 is the maximum brightness.
        brightness_step: Change brightness by an amount.
        brightness_step_pct: Change brightness by a percentage.
        color_name: A human-readable color name.
        color_temp_kelvin: Color temperature in Kelvin.
        effect: Light effect.
        flash: Tell light to flash, can be either value short or long.
        hs_color: Color in hue/sat format. A list of two integers. Hue is 0-360 and Sat is 0-100.
        profile: Name of a light profile to use.
        rgb_color: The color in RGB format. A list of three integers between 0 and 255 representing the values of
            red, green, and blue.
        rgbw_color: The color in RGBW format. A list of four integers between 0 and 255 representing the values of
            red, green, blue, and white.
        rgbww_color: The color in RGBWW format. A list of five integers between 0 and 255 representing the values of
            red, green, blue, cold white, and warm white.
        transition: Duration it takes to get to next state.
        white: Set the light to white mode.
        xy_color: Color in XY-format. A list of two decimal numbers between 0 and 1.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="turn_on",
        target={"entity_id": self.entity.entity_id},
        brightness=brightness,
        brightness_pct=brightness_pct,
        brightness_step=brightness_step,
        brightness_step_pct=brightness_step_pct,
        color_name=color_name,
        color_temp_kelvin=color_temp_kelvin,
        effect=effect,
        flash=flash,
        hs_color=hs_color,
        profile=profile,
        rgb_color=rgb_color,
        rgbw_color=rgbw_color,
        rgbww_color=rgbww_color,
        transition=transition,
        white=white,
        xy_color=xy_color,
    )

turn_off(*, flash: LightFlash | None = None, transition: int | None = None) -> None

Turns off one or more lights.

Parameters:

Name Type Description Default
flash LightFlash | None

Tell light to flash, can be either value short or long.

None
transition int | None

Duration it takes to get to next state.

None
Source code in src/hassette/models/entities/light.py
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
def turn_off(
    self,
    *,
    flash: LightFlash | None = None,
    transition: int | None = None,
) -> None:
    """Turns off one or more lights.

    Args:
        flash: Tell light to flash, can be either value short or long.
        transition: Duration it takes to get to next state.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="turn_off",
        target={"entity_id": self.entity.entity_id},
        flash=flash,
        transition=transition,
    )

toggle(*, brightness: int | None = None, brightness_pct: int | None = None, color_name: Color | None = None, color_temp_kelvin: int | None = None, effect: str | None = None, flash: LightFlash | None = None, hs_color: tuple[float, float] | None = None, profile: str | None = None, rgb_color: tuple[int, int, int] | None = None, rgbw_color: tuple[int, int, int, int] | None = None, rgbww_color: tuple[int, int, int, int, int] | None = None, transition: int | None = None, white: int | None = None, xy_color: tuple[float, float] | None = None) -> None

Toggles one or more lights, from on to off, or off to on, based on their current state.

Parameters:

Name Type Description Default
brightness int | None

Number indicating brightness, where 0 turns the light off, 1 is the minimum brightness, and 255 is the maximum brightness.

None
brightness_pct int | None

Number indicating the percentage of full brightness, where 0 turns the light off, 1 is the minimum brightness, and 100 is the maximum brightness.

None
color_name Color | None

A human-readable color name.

None
color_temp_kelvin int | None

Color temperature in Kelvin.

None
effect str | None

Light effect.

None
flash LightFlash | None

Tell light to flash, can be either value short or long.

None
hs_color tuple[float, float] | None

Color in hue/sat format. A list of two integers. Hue is 0-360 and Sat is 0-100.

None
profile str | None

Name of a light profile to use.

None
rgb_color tuple[int, int, int] | None

The color in RGB format. A list of three integers between 0 and 255 representing the values of red, green, and blue.

None
rgbw_color tuple[int, int, int, int] | None

The color in RGBW format. A list of four integers between 0 and 255 representing the values of red, green, blue, and white.

None
rgbww_color tuple[int, int, int, int, int] | None

The color in RGBWW format. A list of five integers between 0 and 255 representing the values of red, green, blue, cold white, and warm white.

None
transition int | None

Duration it takes to get to next state.

None
white int | None

Set the light to white mode.

None
xy_color tuple[float, float] | None

Color in XY-format. A list of two decimal numbers between 0 and 1.

None
Source code in src/hassette/models/entities/light.py
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
def toggle(
    self,
    *,
    brightness: int | None = None,
    brightness_pct: int | None = None,
    color_name: Color | None = None,
    color_temp_kelvin: int | None = None,
    effect: str | None = None,
    flash: LightFlash | None = None,
    hs_color: tuple[float, float] | None = None,
    profile: str | None = None,
    rgb_color: tuple[int, int, int] | None = None,
    rgbw_color: tuple[int, int, int, int] | None = None,
    rgbww_color: tuple[int, int, int, int, int] | None = None,
    transition: int | None = None,
    white: int | None = None,
    xy_color: tuple[float, float] | None = None,
) -> None:
    """Toggles one or more lights, from on to off, or off to on, based on their current state.

    Args:
        brightness: Number indicating brightness, where 0 turns the light off, 1 is the minimum brightness, and 255
            is the maximum brightness.
        brightness_pct: Number indicating the percentage of full brightness, where 0 turns the light off, 1 is the
            minimum brightness, and 100 is the maximum brightness.
        color_name: A human-readable color name.
        color_temp_kelvin: Color temperature in Kelvin.
        effect: Light effect.
        flash: Tell light to flash, can be either value short or long.
        hs_color: Color in hue/sat format. A list of two integers. Hue is 0-360 and Sat is 0-100.
        profile: Name of a light profile to use.
        rgb_color: The color in RGB format. A list of three integers between 0 and 255 representing the values of
            red, green, and blue.
        rgbw_color: The color in RGBW format. A list of four integers between 0 and 255 representing the values of
            red, green, blue, and white.
        rgbww_color: The color in RGBWW format. A list of five integers between 0 and 255 representing the values of
            red, green, blue, cold white, and warm white.
        transition: Duration it takes to get to next state.
        white: Set the light to white mode.
        xy_color: Color in XY-format. A list of two decimal numbers between 0 and 1.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="toggle",
        target={"entity_id": self.entity.entity_id},
        brightness=brightness,
        brightness_pct=brightness_pct,
        color_name=color_name,
        color_temp_kelvin=color_temp_kelvin,
        effect=effect,
        flash=flash,
        hs_color=hs_color,
        profile=profile,
        rgb_color=rgb_color,
        rgbw_color=rgbw_color,
        rgbww_color=rgbww_color,
        transition=transition,
        white=white,
        xy_color=xy_color,
    )

LockEntity

Bases: BaseEntity[LockState, str]

Source code in src/hassette/models/entities/lock.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
class LockEntity(BaseEntity[LockState, str]):
    @property
    def attributes(self) -> LockAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "LockEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(LockEntitySyncFacade)

    def lock(
        self,
        *,
        code: str | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Locks a lock.

        Args:
            code: Code used to lock the lock.
        """
        return self.api.call_service(
            domain=self.domain,
            service="lock",
            target={"entity_id": self.entity_id},
            code=code,
        )

    def open(
        self,
        *,
        code: str | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Opens a lock.

        Args:
            code: Code used to open the lock.
        """
        return self.api.call_service(
            domain=self.domain,
            service="open",
            target={"entity_id": self.entity_id},
            code=code,
        )

    def unlock(
        self,
        *,
        code: str | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Unlocks a lock.

        Args:
            code: Code used to unlock the lock.
        """
        return self.api.call_service(
            domain=self.domain,
            service="unlock",
            target={"entity_id": self.entity_id},
            code=code,
        )

sync: LockEntitySyncFacade property

Return the typed synchronous facade for this entity.

lock(*, code: str | None = None) -> Coroutine[Any, Any, None]

Locks a lock.

Parameters:

Name Type Description Default
code str | None

Code used to lock the lock.

None
Source code in src/hassette/models/entities/lock.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
def lock(
    self,
    *,
    code: str | None = None,
) -> Coroutine[Any, Any, None]:
    """Locks a lock.

    Args:
        code: Code used to lock the lock.
    """
    return self.api.call_service(
        domain=self.domain,
        service="lock",
        target={"entity_id": self.entity_id},
        code=code,
    )

open(*, code: str | None = None) -> Coroutine[Any, Any, None]

Opens a lock.

Parameters:

Name Type Description Default
code str | None

Code used to open the lock.

None
Source code in src/hassette/models/entities/lock.py
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
def open(
    self,
    *,
    code: str | None = None,
) -> Coroutine[Any, Any, None]:
    """Opens a lock.

    Args:
        code: Code used to open the lock.
    """
    return self.api.call_service(
        domain=self.domain,
        service="open",
        target={"entity_id": self.entity_id},
        code=code,
    )

unlock(*, code: str | None = None) -> Coroutine[Any, Any, None]

Unlocks a lock.

Parameters:

Name Type Description Default
code str | None

Code used to unlock the lock.

None
Source code in src/hassette/models/entities/lock.py
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
def unlock(
    self,
    *,
    code: str | None = None,
) -> Coroutine[Any, Any, None]:
    """Unlocks a lock.

    Args:
        code: Code used to unlock the lock.
    """
    return self.api.call_service(
        domain=self.domain,
        service="unlock",
        target={"entity_id": self.entity_id},
        code=code,
    )

LockEntitySyncFacade

Bases: BaseEntitySyncFacade[LockState, str]

Synchronous facade for LockEntity service methods.

Source code in src/hassette/models/entities/lock.py
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
class LockEntitySyncFacade(BaseEntitySyncFacade[LockState, str]):
    """Synchronous facade for LockEntity service methods."""

    def lock(
        self,
        *,
        code: str | None = None,
    ) -> None:
        """Locks a lock.

        Args:
            code: Code used to lock the lock.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="lock",
            target={"entity_id": self.entity.entity_id},
            code=code,
        )

    def open(
        self,
        *,
        code: str | None = None,
    ) -> None:
        """Opens a lock.

        Args:
            code: Code used to open the lock.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="open",
            target={"entity_id": self.entity.entity_id},
            code=code,
        )

    def unlock(
        self,
        *,
        code: str | None = None,
    ) -> None:
        """Unlocks a lock.

        Args:
            code: Code used to unlock the lock.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="unlock",
            target={"entity_id": self.entity.entity_id},
            code=code,
        )

lock(*, code: str | None = None) -> None

Locks a lock.

Parameters:

Name Type Description Default
code str | None

Code used to lock the lock.

None
Source code in src/hassette/models/entities/lock.py
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
def lock(
    self,
    *,
    code: str | None = None,
) -> None:
    """Locks a lock.

    Args:
        code: Code used to lock the lock.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="lock",
        target={"entity_id": self.entity.entity_id},
        code=code,
    )

open(*, code: str | None = None) -> None

Opens a lock.

Parameters:

Name Type Description Default
code str | None

Code used to open the lock.

None
Source code in src/hassette/models/entities/lock.py
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
def open(
    self,
    *,
    code: str | None = None,
) -> None:
    """Opens a lock.

    Args:
        code: Code used to open the lock.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="open",
        target={"entity_id": self.entity.entity_id},
        code=code,
    )

unlock(*, code: str | None = None) -> None

Unlocks a lock.

Parameters:

Name Type Description Default
code str | None

Code used to unlock the lock.

None
Source code in src/hassette/models/entities/lock.py
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
def unlock(
    self,
    *,
    code: str | None = None,
) -> None:
    """Unlocks a lock.

    Args:
        code: Code used to unlock the lock.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="unlock",
        target={"entity_id": self.entity.entity_id},
        code=code,
    )

MediaPlayerEntity

Bases: BaseEntity[MediaPlayerState, str]

Source code in src/hassette/models/entities/media_player.py
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
class MediaPlayerEntity(BaseEntity[MediaPlayerState, str]):
    @property
    def attributes(self) -> MediaPlayerAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "MediaPlayerEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(MediaPlayerEntitySyncFacade)

    def turn_on(self) -> Coroutine[Any, Any, None]:
        """Turns on the power of a media player."""
        return self.api.call_service(
            domain=self.domain,
            service="turn_on",
            target={"entity_id": self.entity_id},
        )

    def turn_off(self) -> Coroutine[Any, Any, None]:
        """Turns off the power of a media player."""
        return self.api.call_service(
            domain=self.domain,
            service="turn_off",
            target={"entity_id": self.entity_id},
        )

    def toggle(self) -> Coroutine[Any, Any, None]:
        """Toggles a media player on/off."""
        return self.api.call_service(
            domain=self.domain,
            service="toggle",
            target={"entity_id": self.entity_id},
        )

    def volume_up(self) -> Coroutine[Any, Any, None]:
        """Turns up the volume of a media player."""
        return self.api.call_service(
            domain=self.domain,
            service="volume_up",
            target={"entity_id": self.entity_id},
        )

    def volume_down(self) -> Coroutine[Any, Any, None]:
        """Turns down the volume of a media player."""
        return self.api.call_service(
            domain=self.domain,
            service="volume_down",
            target={"entity_id": self.entity_id},
        )

    def volume_mute(
        self,
        *,
        is_volume_muted: bool,
    ) -> Coroutine[Any, Any, None]:
        """Mutes or unmutes a media player.

        Args:
            is_volume_muted: Defines whether or not it is muted.
        """
        return self.api.call_service(
            domain=self.domain,
            service="volume_mute",
            target={"entity_id": self.entity_id},
            is_volume_muted=is_volume_muted,
        )

    def volume_set(
        self,
        *,
        volume_level: float,
    ) -> Coroutine[Any, Any, None]:
        """Sets the volume level of a media player.

        Args:
            volume_level: The volume. 0 is inaudible, 1 is the maximum volume.
        """
        return self.api.call_service(
            domain=self.domain,
            service="volume_set",
            target={"entity_id": self.entity_id},
            volume_level=volume_level,
        )

    def media_play_pause(self) -> Coroutine[Any, Any, None]:
        """Toggles play/pause on a media player."""
        return self.api.call_service(
            domain=self.domain,
            service="media_play_pause",
            target={"entity_id": self.entity_id},
        )

    def media_play(self) -> Coroutine[Any, Any, None]:
        """Starts playback on a media player."""
        return self.api.call_service(
            domain=self.domain,
            service="media_play",
            target={"entity_id": self.entity_id},
        )

    def media_pause(self) -> Coroutine[Any, Any, None]:
        """Pauses playback on a media player."""
        return self.api.call_service(
            domain=self.domain,
            service="media_pause",
            target={"entity_id": self.entity_id},
        )

    def media_stop(self) -> Coroutine[Any, Any, None]:
        """Stops playback on a media player."""
        return self.api.call_service(
            domain=self.domain,
            service="media_stop",
            target={"entity_id": self.entity_id},
        )

    def media_next_track(self) -> Coroutine[Any, Any, None]:
        """Selects the next track on a media player."""
        return self.api.call_service(
            domain=self.domain,
            service="media_next_track",
            target={"entity_id": self.entity_id},
        )

    def media_previous_track(self) -> Coroutine[Any, Any, None]:
        """Selects the previous track on a media player."""
        return self.api.call_service(
            domain=self.domain,
            service="media_previous_track",
            target={"entity_id": self.entity_id},
        )

    def media_seek(
        self,
        *,
        seek_position: float,
    ) -> Coroutine[Any, Any, None]:
        """Allows you to go to a different part of the media that is currently playing on a media player.

        Args:
            seek_position: Target position in the currently playing media. The format is platform dependent.
        """
        return self.api.call_service(
            domain=self.domain,
            service="media_seek",
            target={"entity_id": self.entity_id},
            seek_position=seek_position,
        )

    def play_media(
        self,
        *,
        media: dict[str, Any],
        announce: bool | None = None,
        enqueue: MediaPlayerEnqueue | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Starts playing specified media on a media player.

        Args:
            media: The media selected to play.
            announce: If the media should be played as an announcement.
            enqueue: If the content should be played now or be added to the queue.
        """
        return self.api.call_service(
            domain=self.domain,
            service="play_media",
            target={"entity_id": self.entity_id},
            media=media,
            announce=announce,
            enqueue=enqueue,
        )

    def browse_media(
        self,
        *,
        media_content_id: str | None = None,
        media_type: MediaType | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Browses the available media.

        Args:
            media_content_id: The ID of the content to browse. Integration dependent.
            media_type: The type of the content to browse, such as image, music, TV show, video, episode, channel, or
                playlist.
        """
        return self.api.call_service(
            domain=self.domain,
            service="browse_media",
            target={"entity_id": self.entity_id},
            media_content_id=media_content_id,
            media_type=media_type,
        )

    def search_media(
        self,
        *,
        search_query: str,
        media_content_id: str | None = None,
        media_filter_classes: list[str] | None = None,
        media_type: MediaType | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Searches the available media.

        Args:
            search_query: The term to search for.
            media_content_id: The ID of the content to browse. Integration dependent.
            media_filter_classes: List of media classes to filter the search results by.
            media_type: The type of the content to browse, such as image, music, TV show, video, episode, channel, or
                playlist.
        """
        return self.api.call_service(
            domain=self.domain,
            service="search_media",
            target={"entity_id": self.entity_id},
            search_query=search_query,
            media_content_id=media_content_id,
            media_filter_classes=media_filter_classes,
            media_type=media_type,
        )

    def select_source(
        self,
        *,
        source: str,
    ) -> Coroutine[Any, Any, None]:
        """Sends a media player the command to change the input source.

        Args:
            source: Name of the source to switch to. Platform dependent.
        """
        return self.api.call_service(
            domain=self.domain,
            service="select_source",
            target={"entity_id": self.entity_id},
            source=source,
        )

    def select_sound_mode(
        self,
        *,
        sound_mode: str | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Selects a specific sound mode of a media player.

        Args:
            sound_mode: Name of the sound mode to switch to.
        """
        return self.api.call_service(
            domain=self.domain,
            service="select_sound_mode",
            target={"entity_id": self.entity_id},
            sound_mode=sound_mode,
        )

    def clear_playlist(self) -> Coroutine[Any, Any, None]:
        """Removes all items from a media player's playlist."""
        return self.api.call_service(
            domain=self.domain,
            service="clear_playlist",
            target={"entity_id": self.entity_id},
        )

    def shuffle_set(
        self,
        *,
        shuffle: bool,
    ) -> Coroutine[Any, Any, None]:
        """Enables or disables the shuffle mode of a media player.

        Args:
            shuffle: Whether the media should be played in randomized order or not.
        """
        return self.api.call_service(
            domain=self.domain,
            service="shuffle_set",
            target={"entity_id": self.entity_id},
            shuffle=shuffle,
        )

    def repeat_set(
        self,
        *,
        repeat: RepeatMode,
    ) -> Coroutine[Any, Any, None]:
        """Sets the repeat mode of a media player.

        Args:
            repeat: Whether the media (one or all) should be played in a loop or not.
        """
        return self.api.call_service(
            domain=self.domain,
            service="repeat_set",
            target={"entity_id": self.entity_id},
            repeat=repeat,
        )

    def join(
        self,
        *,
        group_members: list[str],
    ) -> Coroutine[Any, Any, None]:
        """Groups media players together for synchronous playback. Only works on supported multiroom audio systems.

        Args:
            group_members: The players which will be synced with the playback specified in 'Targets'.
        """
        return self.api.call_service(
            domain=self.domain,
            service="join",
            target={"entity_id": self.entity_id},
            group_members=group_members,
        )

    def unjoin(self) -> Coroutine[Any, Any, None]:
        """Removes a media player from a group. Only works on platforms which support player groups."""
        return self.api.call_service(
            domain=self.domain,
            service="unjoin",
            target={"entity_id": self.entity_id},
        )

sync: MediaPlayerEntitySyncFacade property

Return the typed synchronous facade for this entity.

turn_on() -> Coroutine[Any, Any, None]

Turns on the power of a media player.

Source code in src/hassette/models/entities/media_player.py
20
21
22
23
24
25
26
def turn_on(self) -> Coroutine[Any, Any, None]:
    """Turns on the power of a media player."""
    return self.api.call_service(
        domain=self.domain,
        service="turn_on",
        target={"entity_id": self.entity_id},
    )

turn_off() -> Coroutine[Any, Any, None]

Turns off the power of a media player.

Source code in src/hassette/models/entities/media_player.py
28
29
30
31
32
33
34
def turn_off(self) -> Coroutine[Any, Any, None]:
    """Turns off the power of a media player."""
    return self.api.call_service(
        domain=self.domain,
        service="turn_off",
        target={"entity_id": self.entity_id},
    )

toggle() -> Coroutine[Any, Any, None]

Toggles a media player on/off.

Source code in src/hassette/models/entities/media_player.py
36
37
38
39
40
41
42
def toggle(self) -> Coroutine[Any, Any, None]:
    """Toggles a media player on/off."""
    return self.api.call_service(
        domain=self.domain,
        service="toggle",
        target={"entity_id": self.entity_id},
    )

volume_up() -> Coroutine[Any, Any, None]

Turns up the volume of a media player.

Source code in src/hassette/models/entities/media_player.py
44
45
46
47
48
49
50
def volume_up(self) -> Coroutine[Any, Any, None]:
    """Turns up the volume of a media player."""
    return self.api.call_service(
        domain=self.domain,
        service="volume_up",
        target={"entity_id": self.entity_id},
    )

volume_down() -> Coroutine[Any, Any, None]

Turns down the volume of a media player.

Source code in src/hassette/models/entities/media_player.py
52
53
54
55
56
57
58
def volume_down(self) -> Coroutine[Any, Any, None]:
    """Turns down the volume of a media player."""
    return self.api.call_service(
        domain=self.domain,
        service="volume_down",
        target={"entity_id": self.entity_id},
    )

volume_mute(*, is_volume_muted: bool) -> Coroutine[Any, Any, None]

Mutes or unmutes a media player.

Parameters:

Name Type Description Default
is_volume_muted bool

Defines whether or not it is muted.

required
Source code in src/hassette/models/entities/media_player.py
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
def volume_mute(
    self,
    *,
    is_volume_muted: bool,
) -> Coroutine[Any, Any, None]:
    """Mutes or unmutes a media player.

    Args:
        is_volume_muted: Defines whether or not it is muted.
    """
    return self.api.call_service(
        domain=self.domain,
        service="volume_mute",
        target={"entity_id": self.entity_id},
        is_volume_muted=is_volume_muted,
    )

volume_set(*, volume_level: float) -> Coroutine[Any, Any, None]

Sets the volume level of a media player.

Parameters:

Name Type Description Default
volume_level float

The volume. 0 is inaudible, 1 is the maximum volume.

required
Source code in src/hassette/models/entities/media_player.py
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
def volume_set(
    self,
    *,
    volume_level: float,
) -> Coroutine[Any, Any, None]:
    """Sets the volume level of a media player.

    Args:
        volume_level: The volume. 0 is inaudible, 1 is the maximum volume.
    """
    return self.api.call_service(
        domain=self.domain,
        service="volume_set",
        target={"entity_id": self.entity_id},
        volume_level=volume_level,
    )

media_play_pause() -> Coroutine[Any, Any, None]

Toggles play/pause on a media player.

Source code in src/hassette/models/entities/media_player.py
 94
 95
 96
 97
 98
 99
100
def media_play_pause(self) -> Coroutine[Any, Any, None]:
    """Toggles play/pause on a media player."""
    return self.api.call_service(
        domain=self.domain,
        service="media_play_pause",
        target={"entity_id": self.entity_id},
    )

media_play() -> Coroutine[Any, Any, None]

Starts playback on a media player.

Source code in src/hassette/models/entities/media_player.py
102
103
104
105
106
107
108
def media_play(self) -> Coroutine[Any, Any, None]:
    """Starts playback on a media player."""
    return self.api.call_service(
        domain=self.domain,
        service="media_play",
        target={"entity_id": self.entity_id},
    )

media_pause() -> Coroutine[Any, Any, None]

Pauses playback on a media player.

Source code in src/hassette/models/entities/media_player.py
110
111
112
113
114
115
116
def media_pause(self) -> Coroutine[Any, Any, None]:
    """Pauses playback on a media player."""
    return self.api.call_service(
        domain=self.domain,
        service="media_pause",
        target={"entity_id": self.entity_id},
    )

media_stop() -> Coroutine[Any, Any, None]

Stops playback on a media player.

Source code in src/hassette/models/entities/media_player.py
118
119
120
121
122
123
124
def media_stop(self) -> Coroutine[Any, Any, None]:
    """Stops playback on a media player."""
    return self.api.call_service(
        domain=self.domain,
        service="media_stop",
        target={"entity_id": self.entity_id},
    )

media_next_track() -> Coroutine[Any, Any, None]

Selects the next track on a media player.

Source code in src/hassette/models/entities/media_player.py
126
127
128
129
130
131
132
def media_next_track(self) -> Coroutine[Any, Any, None]:
    """Selects the next track on a media player."""
    return self.api.call_service(
        domain=self.domain,
        service="media_next_track",
        target={"entity_id": self.entity_id},
    )

media_previous_track() -> Coroutine[Any, Any, None]

Selects the previous track on a media player.

Source code in src/hassette/models/entities/media_player.py
134
135
136
137
138
139
140
def media_previous_track(self) -> Coroutine[Any, Any, None]:
    """Selects the previous track on a media player."""
    return self.api.call_service(
        domain=self.domain,
        service="media_previous_track",
        target={"entity_id": self.entity_id},
    )

media_seek(*, seek_position: float) -> Coroutine[Any, Any, None]

Allows you to go to a different part of the media that is currently playing on a media player.

Parameters:

Name Type Description Default
seek_position float

Target position in the currently playing media. The format is platform dependent.

required
Source code in src/hassette/models/entities/media_player.py
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
def media_seek(
    self,
    *,
    seek_position: float,
) -> Coroutine[Any, Any, None]:
    """Allows you to go to a different part of the media that is currently playing on a media player.

    Args:
        seek_position: Target position in the currently playing media. The format is platform dependent.
    """
    return self.api.call_service(
        domain=self.domain,
        service="media_seek",
        target={"entity_id": self.entity_id},
        seek_position=seek_position,
    )

play_media(*, media: dict[str, Any], announce: bool | None = None, enqueue: MediaPlayerEnqueue | None = None) -> Coroutine[Any, Any, None]

Starts playing specified media on a media player.

Parameters:

Name Type Description Default
media dict[str, Any]

The media selected to play.

required
announce bool | None

If the media should be played as an announcement.

None
enqueue MediaPlayerEnqueue | None

If the content should be played now or be added to the queue.

None
Source code in src/hassette/models/entities/media_player.py
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
def play_media(
    self,
    *,
    media: dict[str, Any],
    announce: bool | None = None,
    enqueue: MediaPlayerEnqueue | None = None,
) -> Coroutine[Any, Any, None]:
    """Starts playing specified media on a media player.

    Args:
        media: The media selected to play.
        announce: If the media should be played as an announcement.
        enqueue: If the content should be played now or be added to the queue.
    """
    return self.api.call_service(
        domain=self.domain,
        service="play_media",
        target={"entity_id": self.entity_id},
        media=media,
        announce=announce,
        enqueue=enqueue,
    )

browse_media(*, media_content_id: str | None = None, media_type: MediaType | None = None) -> Coroutine[Any, Any, None]

Browses the available media.

Parameters:

Name Type Description Default
media_content_id str | None

The ID of the content to browse. Integration dependent.

None
media_type MediaType | None

The type of the content to browse, such as image, music, TV show, video, episode, channel, or playlist.

None
Source code in src/hassette/models/entities/media_player.py
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
def browse_media(
    self,
    *,
    media_content_id: str | None = None,
    media_type: MediaType | None = None,
) -> Coroutine[Any, Any, None]:
    """Browses the available media.

    Args:
        media_content_id: The ID of the content to browse. Integration dependent.
        media_type: The type of the content to browse, such as image, music, TV show, video, episode, channel, or
            playlist.
    """
    return self.api.call_service(
        domain=self.domain,
        service="browse_media",
        target={"entity_id": self.entity_id},
        media_content_id=media_content_id,
        media_type=media_type,
    )

search_media(*, search_query: str, media_content_id: str | None = None, media_filter_classes: list[str] | None = None, media_type: MediaType | None = None) -> Coroutine[Any, Any, None]

Searches the available media.

Parameters:

Name Type Description Default
search_query str

The term to search for.

required
media_content_id str | None

The ID of the content to browse. Integration dependent.

None
media_filter_classes list[str] | None

List of media classes to filter the search results by.

None
media_type MediaType | None

The type of the content to browse, such as image, music, TV show, video, episode, channel, or playlist.

None
Source code in src/hassette/models/entities/media_player.py
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
def search_media(
    self,
    *,
    search_query: str,
    media_content_id: str | None = None,
    media_filter_classes: list[str] | None = None,
    media_type: MediaType | None = None,
) -> Coroutine[Any, Any, None]:
    """Searches the available media.

    Args:
        search_query: The term to search for.
        media_content_id: The ID of the content to browse. Integration dependent.
        media_filter_classes: List of media classes to filter the search results by.
        media_type: The type of the content to browse, such as image, music, TV show, video, episode, channel, or
            playlist.
    """
    return self.api.call_service(
        domain=self.domain,
        service="search_media",
        target={"entity_id": self.entity_id},
        search_query=search_query,
        media_content_id=media_content_id,
        media_filter_classes=media_filter_classes,
        media_type=media_type,
    )

select_source(*, source: str) -> Coroutine[Any, Any, None]

Sends a media player the command to change the input source.

Parameters:

Name Type Description Default
source str

Name of the source to switch to. Platform dependent.

required
Source code in src/hassette/models/entities/media_player.py
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
def select_source(
    self,
    *,
    source: str,
) -> Coroutine[Any, Any, None]:
    """Sends a media player the command to change the input source.

    Args:
        source: Name of the source to switch to. Platform dependent.
    """
    return self.api.call_service(
        domain=self.domain,
        service="select_source",
        target={"entity_id": self.entity_id},
        source=source,
    )

select_sound_mode(*, sound_mode: str | None = None) -> Coroutine[Any, Any, None]

Selects a specific sound mode of a media player.

Parameters:

Name Type Description Default
sound_mode str | None

Name of the sound mode to switch to.

None
Source code in src/hassette/models/entities/media_player.py
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
def select_sound_mode(
    self,
    *,
    sound_mode: str | None = None,
) -> Coroutine[Any, Any, None]:
    """Selects a specific sound mode of a media player.

    Args:
        sound_mode: Name of the sound mode to switch to.
    """
    return self.api.call_service(
        domain=self.domain,
        service="select_sound_mode",
        target={"entity_id": self.entity_id},
        sound_mode=sound_mode,
    )

clear_playlist() -> Coroutine[Any, Any, None]

Removes all items from a media player's playlist.

Source code in src/hassette/models/entities/media_player.py
264
265
266
267
268
269
270
def clear_playlist(self) -> Coroutine[Any, Any, None]:
    """Removes all items from a media player's playlist."""
    return self.api.call_service(
        domain=self.domain,
        service="clear_playlist",
        target={"entity_id": self.entity_id},
    )

shuffle_set(*, shuffle: bool) -> Coroutine[Any, Any, None]

Enables or disables the shuffle mode of a media player.

Parameters:

Name Type Description Default
shuffle bool

Whether the media should be played in randomized order or not.

required
Source code in src/hassette/models/entities/media_player.py
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
def shuffle_set(
    self,
    *,
    shuffle: bool,
) -> Coroutine[Any, Any, None]:
    """Enables or disables the shuffle mode of a media player.

    Args:
        shuffle: Whether the media should be played in randomized order or not.
    """
    return self.api.call_service(
        domain=self.domain,
        service="shuffle_set",
        target={"entity_id": self.entity_id},
        shuffle=shuffle,
    )

repeat_set(*, repeat: RepeatMode) -> Coroutine[Any, Any, None]

Sets the repeat mode of a media player.

Parameters:

Name Type Description Default
repeat RepeatMode

Whether the media (one or all) should be played in a loop or not.

required
Source code in src/hassette/models/entities/media_player.py
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
def repeat_set(
    self,
    *,
    repeat: RepeatMode,
) -> Coroutine[Any, Any, None]:
    """Sets the repeat mode of a media player.

    Args:
        repeat: Whether the media (one or all) should be played in a loop or not.
    """
    return self.api.call_service(
        domain=self.domain,
        service="repeat_set",
        target={"entity_id": self.entity_id},
        repeat=repeat,
    )

join(*, group_members: list[str]) -> Coroutine[Any, Any, None]

Groups media players together for synchronous playback. Only works on supported multiroom audio systems.

Parameters:

Name Type Description Default
group_members list[str]

The players which will be synced with the playback specified in 'Targets'.

required
Source code in src/hassette/models/entities/media_player.py
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
def join(
    self,
    *,
    group_members: list[str],
) -> Coroutine[Any, Any, None]:
    """Groups media players together for synchronous playback. Only works on supported multiroom audio systems.

    Args:
        group_members: The players which will be synced with the playback specified in 'Targets'.
    """
    return self.api.call_service(
        domain=self.domain,
        service="join",
        target={"entity_id": self.entity_id},
        group_members=group_members,
    )

unjoin() -> Coroutine[Any, Any, None]

Removes a media player from a group. Only works on platforms which support player groups.

Source code in src/hassette/models/entities/media_player.py
323
324
325
326
327
328
329
def unjoin(self) -> Coroutine[Any, Any, None]:
    """Removes a media player from a group. Only works on platforms which support player groups."""
    return self.api.call_service(
        domain=self.domain,
        service="unjoin",
        target={"entity_id": self.entity_id},
    )

MediaPlayerEntitySyncFacade

Bases: BaseEntitySyncFacade[MediaPlayerState, str]

Synchronous facade for MediaPlayerEntity service methods.

Source code in src/hassette/models/entities/media_player.py
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
class MediaPlayerEntitySyncFacade(BaseEntitySyncFacade[MediaPlayerState, str]):
    """Synchronous facade for MediaPlayerEntity service methods."""

    def turn_on(self) -> None:
        """Turns on the power of a media player."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="turn_on",
            target={"entity_id": self.entity.entity_id},
        )

    def turn_off(self) -> None:
        """Turns off the power of a media player."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="turn_off",
            target={"entity_id": self.entity.entity_id},
        )

    def toggle(self) -> None:
        """Toggles a media player on/off."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="toggle",
            target={"entity_id": self.entity.entity_id},
        )

    def volume_up(self) -> None:
        """Turns up the volume of a media player."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="volume_up",
            target={"entity_id": self.entity.entity_id},
        )

    def volume_down(self) -> None:
        """Turns down the volume of a media player."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="volume_down",
            target={"entity_id": self.entity.entity_id},
        )

    def volume_mute(
        self,
        *,
        is_volume_muted: bool,
    ) -> None:
        """Mutes or unmutes a media player.

        Args:
            is_volume_muted: Defines whether or not it is muted.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="volume_mute",
            target={"entity_id": self.entity.entity_id},
            is_volume_muted=is_volume_muted,
        )

    def volume_set(
        self,
        *,
        volume_level: float,
    ) -> None:
        """Sets the volume level of a media player.

        Args:
            volume_level: The volume. 0 is inaudible, 1 is the maximum volume.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="volume_set",
            target={"entity_id": self.entity.entity_id},
            volume_level=volume_level,
        )

    def media_play_pause(self) -> None:
        """Toggles play/pause on a media player."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="media_play_pause",
            target={"entity_id": self.entity.entity_id},
        )

    def media_play(self) -> None:
        """Starts playback on a media player."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="media_play",
            target={"entity_id": self.entity.entity_id},
        )

    def media_pause(self) -> None:
        """Pauses playback on a media player."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="media_pause",
            target={"entity_id": self.entity.entity_id},
        )

    def media_stop(self) -> None:
        """Stops playback on a media player."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="media_stop",
            target={"entity_id": self.entity.entity_id},
        )

    def media_next_track(self) -> None:
        """Selects the next track on a media player."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="media_next_track",
            target={"entity_id": self.entity.entity_id},
        )

    def media_previous_track(self) -> None:
        """Selects the previous track on a media player."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="media_previous_track",
            target={"entity_id": self.entity.entity_id},
        )

    def media_seek(
        self,
        *,
        seek_position: float,
    ) -> None:
        """Allows you to go to a different part of the media that is currently playing on a media player.

        Args:
            seek_position: Target position in the currently playing media. The format is platform dependent.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="media_seek",
            target={"entity_id": self.entity.entity_id},
            seek_position=seek_position,
        )

    def play_media(
        self,
        *,
        media: dict[str, Any],
        announce: bool | None = None,
        enqueue: MediaPlayerEnqueue | None = None,
    ) -> None:
        """Starts playing specified media on a media player.

        Args:
            media: The media selected to play.
            announce: If the media should be played as an announcement.
            enqueue: If the content should be played now or be added to the queue.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="play_media",
            target={"entity_id": self.entity.entity_id},
            media=media,
            announce=announce,
            enqueue=enqueue,
        )

    def browse_media(
        self,
        *,
        media_content_id: str | None = None,
        media_type: MediaType | None = None,
    ) -> None:
        """Browses the available media.

        Args:
            media_content_id: The ID of the content to browse. Integration dependent.
            media_type: The type of the content to browse, such as image, music, TV show, video, episode, channel, or
                playlist.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="browse_media",
            target={"entity_id": self.entity.entity_id},
            media_content_id=media_content_id,
            media_type=media_type,
        )

    def search_media(
        self,
        *,
        search_query: str,
        media_content_id: str | None = None,
        media_filter_classes: list[str] | None = None,
        media_type: MediaType | None = None,
    ) -> None:
        """Searches the available media.

        Args:
            search_query: The term to search for.
            media_content_id: The ID of the content to browse. Integration dependent.
            media_filter_classes: List of media classes to filter the search results by.
            media_type: The type of the content to browse, such as image, music, TV show, video, episode, channel, or
                playlist.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="search_media",
            target={"entity_id": self.entity.entity_id},
            search_query=search_query,
            media_content_id=media_content_id,
            media_filter_classes=media_filter_classes,
            media_type=media_type,
        )

    def select_source(
        self,
        *,
        source: str,
    ) -> None:
        """Sends a media player the command to change the input source.

        Args:
            source: Name of the source to switch to. Platform dependent.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="select_source",
            target={"entity_id": self.entity.entity_id},
            source=source,
        )

    def select_sound_mode(
        self,
        *,
        sound_mode: str | None = None,
    ) -> None:
        """Selects a specific sound mode of a media player.

        Args:
            sound_mode: Name of the sound mode to switch to.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="select_sound_mode",
            target={"entity_id": self.entity.entity_id},
            sound_mode=sound_mode,
        )

    def clear_playlist(self) -> None:
        """Removes all items from a media player's playlist."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="clear_playlist",
            target={"entity_id": self.entity.entity_id},
        )

    def shuffle_set(
        self,
        *,
        shuffle: bool,
    ) -> None:
        """Enables or disables the shuffle mode of a media player.

        Args:
            shuffle: Whether the media should be played in randomized order or not.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="shuffle_set",
            target={"entity_id": self.entity.entity_id},
            shuffle=shuffle,
        )

    def repeat_set(
        self,
        *,
        repeat: RepeatMode,
    ) -> None:
        """Sets the repeat mode of a media player.

        Args:
            repeat: Whether the media (one or all) should be played in a loop or not.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="repeat_set",
            target={"entity_id": self.entity.entity_id},
            repeat=repeat,
        )

    def join(
        self,
        *,
        group_members: list[str],
    ) -> None:
        """Groups media players together for synchronous playback. Only works on supported multiroom audio systems.

        Args:
            group_members: The players which will be synced with the playback specified in 'Targets'.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="join",
            target={"entity_id": self.entity.entity_id},
            group_members=group_members,
        )

    def unjoin(self) -> None:
        """Removes a media player from a group. Only works on platforms which support player groups."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="unjoin",
            target={"entity_id": self.entity.entity_id},
        )

turn_on() -> None

Turns on the power of a media player.

Source code in src/hassette/models/entities/media_player.py
335
336
337
338
339
340
341
def turn_on(self) -> None:
    """Turns on the power of a media player."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="turn_on",
        target={"entity_id": self.entity.entity_id},
    )

turn_off() -> None

Turns off the power of a media player.

Source code in src/hassette/models/entities/media_player.py
343
344
345
346
347
348
349
def turn_off(self) -> None:
    """Turns off the power of a media player."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="turn_off",
        target={"entity_id": self.entity.entity_id},
    )

toggle() -> None

Toggles a media player on/off.

Source code in src/hassette/models/entities/media_player.py
351
352
353
354
355
356
357
def toggle(self) -> None:
    """Toggles a media player on/off."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="toggle",
        target={"entity_id": self.entity.entity_id},
    )

volume_up() -> None

Turns up the volume of a media player.

Source code in src/hassette/models/entities/media_player.py
359
360
361
362
363
364
365
def volume_up(self) -> None:
    """Turns up the volume of a media player."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="volume_up",
        target={"entity_id": self.entity.entity_id},
    )

volume_down() -> None

Turns down the volume of a media player.

Source code in src/hassette/models/entities/media_player.py
367
368
369
370
371
372
373
def volume_down(self) -> None:
    """Turns down the volume of a media player."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="volume_down",
        target={"entity_id": self.entity.entity_id},
    )

volume_mute(*, is_volume_muted: bool) -> None

Mutes or unmutes a media player.

Parameters:

Name Type Description Default
is_volume_muted bool

Defines whether or not it is muted.

required
Source code in src/hassette/models/entities/media_player.py
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
def volume_mute(
    self,
    *,
    is_volume_muted: bool,
) -> None:
    """Mutes or unmutes a media player.

    Args:
        is_volume_muted: Defines whether or not it is muted.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="volume_mute",
        target={"entity_id": self.entity.entity_id},
        is_volume_muted=is_volume_muted,
    )

volume_set(*, volume_level: float) -> None

Sets the volume level of a media player.

Parameters:

Name Type Description Default
volume_level float

The volume. 0 is inaudible, 1 is the maximum volume.

required
Source code in src/hassette/models/entities/media_player.py
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
def volume_set(
    self,
    *,
    volume_level: float,
) -> None:
    """Sets the volume level of a media player.

    Args:
        volume_level: The volume. 0 is inaudible, 1 is the maximum volume.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="volume_set",
        target={"entity_id": self.entity.entity_id},
        volume_level=volume_level,
    )

media_play_pause() -> None

Toggles play/pause on a media player.

Source code in src/hassette/models/entities/media_player.py
409
410
411
412
413
414
415
def media_play_pause(self) -> None:
    """Toggles play/pause on a media player."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="media_play_pause",
        target={"entity_id": self.entity.entity_id},
    )

media_play() -> None

Starts playback on a media player.

Source code in src/hassette/models/entities/media_player.py
417
418
419
420
421
422
423
def media_play(self) -> None:
    """Starts playback on a media player."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="media_play",
        target={"entity_id": self.entity.entity_id},
    )

media_pause() -> None

Pauses playback on a media player.

Source code in src/hassette/models/entities/media_player.py
425
426
427
428
429
430
431
def media_pause(self) -> None:
    """Pauses playback on a media player."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="media_pause",
        target={"entity_id": self.entity.entity_id},
    )

media_stop() -> None

Stops playback on a media player.

Source code in src/hassette/models/entities/media_player.py
433
434
435
436
437
438
439
def media_stop(self) -> None:
    """Stops playback on a media player."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="media_stop",
        target={"entity_id": self.entity.entity_id},
    )

media_next_track() -> None

Selects the next track on a media player.

Source code in src/hassette/models/entities/media_player.py
441
442
443
444
445
446
447
def media_next_track(self) -> None:
    """Selects the next track on a media player."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="media_next_track",
        target={"entity_id": self.entity.entity_id},
    )

media_previous_track() -> None

Selects the previous track on a media player.

Source code in src/hassette/models/entities/media_player.py
449
450
451
452
453
454
455
def media_previous_track(self) -> None:
    """Selects the previous track on a media player."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="media_previous_track",
        target={"entity_id": self.entity.entity_id},
    )

media_seek(*, seek_position: float) -> None

Allows you to go to a different part of the media that is currently playing on a media player.

Parameters:

Name Type Description Default
seek_position float

Target position in the currently playing media. The format is platform dependent.

required
Source code in src/hassette/models/entities/media_player.py
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
def media_seek(
    self,
    *,
    seek_position: float,
) -> None:
    """Allows you to go to a different part of the media that is currently playing on a media player.

    Args:
        seek_position: Target position in the currently playing media. The format is platform dependent.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="media_seek",
        target={"entity_id": self.entity.entity_id},
        seek_position=seek_position,
    )

play_media(*, media: dict[str, Any], announce: bool | None = None, enqueue: MediaPlayerEnqueue | None = None) -> None

Starts playing specified media on a media player.

Parameters:

Name Type Description Default
media dict[str, Any]

The media selected to play.

required
announce bool | None

If the media should be played as an announcement.

None
enqueue MediaPlayerEnqueue | None

If the content should be played now or be added to the queue.

None
Source code in src/hassette/models/entities/media_player.py
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
def play_media(
    self,
    *,
    media: dict[str, Any],
    announce: bool | None = None,
    enqueue: MediaPlayerEnqueue | None = None,
) -> None:
    """Starts playing specified media on a media player.

    Args:
        media: The media selected to play.
        announce: If the media should be played as an announcement.
        enqueue: If the content should be played now or be added to the queue.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="play_media",
        target={"entity_id": self.entity.entity_id},
        media=media,
        announce=announce,
        enqueue=enqueue,
    )

browse_media(*, media_content_id: str | None = None, media_type: MediaType | None = None) -> None

Browses the available media.

Parameters:

Name Type Description Default
media_content_id str | None

The ID of the content to browse. Integration dependent.

None
media_type MediaType | None

The type of the content to browse, such as image, music, TV show, video, episode, channel, or playlist.

None
Source code in src/hassette/models/entities/media_player.py
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
def browse_media(
    self,
    *,
    media_content_id: str | None = None,
    media_type: MediaType | None = None,
) -> None:
    """Browses the available media.

    Args:
        media_content_id: The ID of the content to browse. Integration dependent.
        media_type: The type of the content to browse, such as image, music, TV show, video, episode, channel, or
            playlist.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="browse_media",
        target={"entity_id": self.entity.entity_id},
        media_content_id=media_content_id,
        media_type=media_type,
    )

search_media(*, search_query: str, media_content_id: str | None = None, media_filter_classes: list[str] | None = None, media_type: MediaType | None = None) -> None

Searches the available media.

Parameters:

Name Type Description Default
search_query str

The term to search for.

required
media_content_id str | None

The ID of the content to browse. Integration dependent.

None
media_filter_classes list[str] | None

List of media classes to filter the search results by.

None
media_type MediaType | None

The type of the content to browse, such as image, music, TV show, video, episode, channel, or playlist.

None
Source code in src/hassette/models/entities/media_player.py
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
def search_media(
    self,
    *,
    search_query: str,
    media_content_id: str | None = None,
    media_filter_classes: list[str] | None = None,
    media_type: MediaType | None = None,
) -> None:
    """Searches the available media.

    Args:
        search_query: The term to search for.
        media_content_id: The ID of the content to browse. Integration dependent.
        media_filter_classes: List of media classes to filter the search results by.
        media_type: The type of the content to browse, such as image, music, TV show, video, episode, channel, or
            playlist.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="search_media",
        target={"entity_id": self.entity.entity_id},
        search_query=search_query,
        media_content_id=media_content_id,
        media_filter_classes=media_filter_classes,
        media_type=media_type,
    )

select_source(*, source: str) -> None

Sends a media player the command to change the input source.

Parameters:

Name Type Description Default
source str

Name of the source to switch to. Platform dependent.

required
Source code in src/hassette/models/entities/media_player.py
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
def select_source(
    self,
    *,
    source: str,
) -> None:
    """Sends a media player the command to change the input source.

    Args:
        source: Name of the source to switch to. Platform dependent.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="select_source",
        target={"entity_id": self.entity.entity_id},
        source=source,
    )

select_sound_mode(*, sound_mode: str | None = None) -> None

Selects a specific sound mode of a media player.

Parameters:

Name Type Description Default
sound_mode str | None

Name of the sound mode to switch to.

None
Source code in src/hassette/models/entities/media_player.py
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
def select_sound_mode(
    self,
    *,
    sound_mode: str | None = None,
) -> None:
    """Selects a specific sound mode of a media player.

    Args:
        sound_mode: Name of the sound mode to switch to.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="select_sound_mode",
        target={"entity_id": self.entity.entity_id},
        sound_mode=sound_mode,
    )

clear_playlist() -> None

Removes all items from a media player's playlist.

Source code in src/hassette/models/entities/media_player.py
579
580
581
582
583
584
585
def clear_playlist(self) -> None:
    """Removes all items from a media player's playlist."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="clear_playlist",
        target={"entity_id": self.entity.entity_id},
    )

shuffle_set(*, shuffle: bool) -> None

Enables or disables the shuffle mode of a media player.

Parameters:

Name Type Description Default
shuffle bool

Whether the media should be played in randomized order or not.

required
Source code in src/hassette/models/entities/media_player.py
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
def shuffle_set(
    self,
    *,
    shuffle: bool,
) -> None:
    """Enables or disables the shuffle mode of a media player.

    Args:
        shuffle: Whether the media should be played in randomized order or not.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="shuffle_set",
        target={"entity_id": self.entity.entity_id},
        shuffle=shuffle,
    )

repeat_set(*, repeat: RepeatMode) -> None

Sets the repeat mode of a media player.

Parameters:

Name Type Description Default
repeat RepeatMode

Whether the media (one or all) should be played in a loop or not.

required
Source code in src/hassette/models/entities/media_player.py
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
def repeat_set(
    self,
    *,
    repeat: RepeatMode,
) -> None:
    """Sets the repeat mode of a media player.

    Args:
        repeat: Whether the media (one or all) should be played in a loop or not.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="repeat_set",
        target={"entity_id": self.entity.entity_id},
        repeat=repeat,
    )

join(*, group_members: list[str]) -> None

Groups media players together for synchronous playback. Only works on supported multiroom audio systems.

Parameters:

Name Type Description Default
group_members list[str]

The players which will be synced with the playback specified in 'Targets'.

required
Source code in src/hassette/models/entities/media_player.py
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
def join(
    self,
    *,
    group_members: list[str],
) -> None:
    """Groups media players together for synchronous playback. Only works on supported multiroom audio systems.

    Args:
        group_members: The players which will be synced with the playback specified in 'Targets'.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="join",
        target={"entity_id": self.entity.entity_id},
        group_members=group_members,
    )

unjoin() -> None

Removes a media player from a group. Only works on platforms which support player groups.

Source code in src/hassette/models/entities/media_player.py
638
639
640
641
642
643
644
def unjoin(self) -> None:
    """Removes a media player from a group. Only works on platforms which support player groups."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="unjoin",
        target={"entity_id": self.entity.entity_id},
    )

NumberEntity

Bases: BaseEntity[NumberState, str]

Source code in src/hassette/models/entities/number.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
class NumberEntity(BaseEntity[NumberState, str]):
    @property
    def attributes(self) -> NumberAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "NumberEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(NumberEntitySyncFacade)

    def set_value(
        self,
        *,
        value: float,
    ) -> Coroutine[Any, Any, None]:
        """Sets the value of a number.

        Args:
            value: The target value to set.
        """
        return self.api.call_service(
            domain=self.domain,
            service="set_value",
            target={"entity_id": self.entity_id},
            value=value,
        )

sync: NumberEntitySyncFacade property

Return the typed synchronous facade for this entity.

set_value(*, value: float) -> Coroutine[Any, Any, None]

Sets the value of a number.

Parameters:

Name Type Description Default
value float

The target value to set.

required
Source code in src/hassette/models/entities/number.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
def set_value(
    self,
    *,
    value: float,
) -> Coroutine[Any, Any, None]:
    """Sets the value of a number.

    Args:
        value: The target value to set.
    """
    return self.api.call_service(
        domain=self.domain,
        service="set_value",
        target={"entity_id": self.entity_id},
        value=value,
    )

NumberEntitySyncFacade

Bases: BaseEntitySyncFacade[NumberState, str]

Synchronous facade for NumberEntity service methods.

Source code in src/hassette/models/entities/number.py
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
class NumberEntitySyncFacade(BaseEntitySyncFacade[NumberState, str]):
    """Synchronous facade for NumberEntity service methods."""

    def set_value(
        self,
        *,
        value: float,
    ) -> None:
        """Sets the value of a number.

        Args:
            value: The target value to set.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="set_value",
            target={"entity_id": self.entity.entity_id},
            value=value,
        )

set_value(*, value: float) -> None

Sets the value of a number.

Parameters:

Name Type Description Default
value float

The target value to set.

required
Source code in src/hassette/models/entities/number.py
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
def set_value(
    self,
    *,
    value: float,
) -> None:
    """Sets the value of a number.

    Args:
        value: The target value to set.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="set_value",
        target={"entity_id": self.entity.entity_id},
        value=value,
    )

RemoteEntity

Bases: BaseEntity[RemoteState, str]

Source code in src/hassette/models/entities/remote.py
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
class RemoteEntity(BaseEntity[RemoteState, str]):
    @property
    def attributes(self) -> RemoteAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "RemoteEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(RemoteEntitySyncFacade)

    def turn_on(
        self,
        *,
        activity: str | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Sends the turn on command.

        Args:
            activity: Activity ID or activity name to be started.
        """
        return self.api.call_service(
            domain=self.domain,
            service="turn_on",
            target={"entity_id": self.entity_id},
            activity=activity,
        )

    def toggle(self) -> Coroutine[Any, Any, None]:
        """Sends the toggle command."""
        return self.api.call_service(
            domain=self.domain,
            service="toggle",
            target={"entity_id": self.entity_id},
        )

    def turn_off(self) -> Coroutine[Any, Any, None]:
        """Sends the turn off command."""
        return self.api.call_service(
            domain=self.domain,
            service="turn_off",
            target={"entity_id": self.entity_id},
        )

    def send_command(
        self,
        *,
        command: Any,
        delay_secs: float | None = None,
        device: str | None = None,
        hold_secs: float | None = None,
        num_repeats: int | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Sends a command or a list of commands to a device.

        Args:
            command: A single command or a list of commands to send.
            delay_secs: The time you want to wait in between repeated commands.
            device: Device ID to send command to.
            hold_secs: The time you want to have it held before the release is send.
            num_repeats: The number of times you want to repeat the commands.
        """
        return self.api.call_service(
            domain=self.domain,
            service="send_command",
            target={"entity_id": self.entity_id},
            command=command,
            delay_secs=delay_secs,
            device=device,
            hold_secs=hold_secs,
            num_repeats=num_repeats,
        )

    def learn_command(
        self,
        *,
        alternative: bool | None = None,
        command: Any | None = None,
        command_type: RemoteCommandType | None = None,
        device: str | None = None,
        timeout: int | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Teaches a remote a command or list of commands from a device.

        Args:
            alternative: If code must be stored as an alternative. This is useful for discrete codes. Discrete codes are
                used for toggles that only perform one function. For example, a code to only turn a device on. If it is
                on already, sending the code won't change the state.
            command: A single command or a list of commands to learn.
            command_type: The type of command to be learned.
            device: Device ID to learn command from.
            timeout: Timeout for the command to be learned.
        """
        return self.api.call_service(
            domain=self.domain,
            service="learn_command",
            target={"entity_id": self.entity_id},
            alternative=alternative,
            command=command,
            command_type=command_type,
            device=device,
            timeout=timeout,
        )

    def delete_command(
        self,
        *,
        command: Any,
        device: str | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Deletes a command or a list of commands from a remote's database.

        Args:
            command: The single command or the list of commands to be deleted.
            device: Device from which commands will be deleted.
        """
        return self.api.call_service(
            domain=self.domain,
            service="delete_command",
            target={"entity_id": self.entity_id},
            command=command,
            device=device,
        )

sync: RemoteEntitySyncFacade property

Return the typed synchronous facade for this entity.

turn_on(*, activity: str | None = None) -> Coroutine[Any, Any, None]

Sends the turn on command.

Parameters:

Name Type Description Default
activity str | None

Activity ID or activity name to be started.

None
Source code in src/hassette/models/entities/remote.py
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
def turn_on(
    self,
    *,
    activity: str | None = None,
) -> Coroutine[Any, Any, None]:
    """Sends the turn on command.

    Args:
        activity: Activity ID or activity name to be started.
    """
    return self.api.call_service(
        domain=self.domain,
        service="turn_on",
        target={"entity_id": self.entity_id},
        activity=activity,
    )

toggle() -> Coroutine[Any, Any, None]

Sends the toggle command.

Source code in src/hassette/models/entities/remote.py
39
40
41
42
43
44
45
def toggle(self) -> Coroutine[Any, Any, None]:
    """Sends the toggle command."""
    return self.api.call_service(
        domain=self.domain,
        service="toggle",
        target={"entity_id": self.entity_id},
    )

turn_off() -> Coroutine[Any, Any, None]

Sends the turn off command.

Source code in src/hassette/models/entities/remote.py
47
48
49
50
51
52
53
def turn_off(self) -> Coroutine[Any, Any, None]:
    """Sends the turn off command."""
    return self.api.call_service(
        domain=self.domain,
        service="turn_off",
        target={"entity_id": self.entity_id},
    )

send_command(*, command: Any, delay_secs: float | None = None, device: str | None = None, hold_secs: float | None = None, num_repeats: int | None = None) -> Coroutine[Any, Any, None]

Sends a command or a list of commands to a device.

Parameters:

Name Type Description Default
command Any

A single command or a list of commands to send.

required
delay_secs float | None

The time you want to wait in between repeated commands.

None
device str | None

Device ID to send command to.

None
hold_secs float | None

The time you want to have it held before the release is send.

None
num_repeats int | None

The number of times you want to repeat the commands.

None
Source code in src/hassette/models/entities/remote.py
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
def send_command(
    self,
    *,
    command: Any,
    delay_secs: float | None = None,
    device: str | None = None,
    hold_secs: float | None = None,
    num_repeats: int | None = None,
) -> Coroutine[Any, Any, None]:
    """Sends a command or a list of commands to a device.

    Args:
        command: A single command or a list of commands to send.
        delay_secs: The time you want to wait in between repeated commands.
        device: Device ID to send command to.
        hold_secs: The time you want to have it held before the release is send.
        num_repeats: The number of times you want to repeat the commands.
    """
    return self.api.call_service(
        domain=self.domain,
        service="send_command",
        target={"entity_id": self.entity_id},
        command=command,
        delay_secs=delay_secs,
        device=device,
        hold_secs=hold_secs,
        num_repeats=num_repeats,
    )

learn_command(*, alternative: bool | None = None, command: Any | None = None, command_type: RemoteCommandType | None = None, device: str | None = None, timeout: int | None = None) -> Coroutine[Any, Any, None]

Teaches a remote a command or list of commands from a device.

Parameters:

Name Type Description Default
alternative bool | None

If code must be stored as an alternative. This is useful for discrete codes. Discrete codes are used for toggles that only perform one function. For example, a code to only turn a device on. If it is on already, sending the code won't change the state.

None
command Any | None

A single command or a list of commands to learn.

None
command_type RemoteCommandType | None

The type of command to be learned.

None
device str | None

Device ID to learn command from.

None
timeout int | None

Timeout for the command to be learned.

None
Source code in src/hassette/models/entities/remote.py
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
def learn_command(
    self,
    *,
    alternative: bool | None = None,
    command: Any | None = None,
    command_type: RemoteCommandType | None = None,
    device: str | None = None,
    timeout: int | None = None,
) -> Coroutine[Any, Any, None]:
    """Teaches a remote a command or list of commands from a device.

    Args:
        alternative: If code must be stored as an alternative. This is useful for discrete codes. Discrete codes are
            used for toggles that only perform one function. For example, a code to only turn a device on. If it is
            on already, sending the code won't change the state.
        command: A single command or a list of commands to learn.
        command_type: The type of command to be learned.
        device: Device ID to learn command from.
        timeout: Timeout for the command to be learned.
    """
    return self.api.call_service(
        domain=self.domain,
        service="learn_command",
        target={"entity_id": self.entity_id},
        alternative=alternative,
        command=command,
        command_type=command_type,
        device=device,
        timeout=timeout,
    )

delete_command(*, command: Any, device: str | None = None) -> Coroutine[Any, Any, None]

Deletes a command or a list of commands from a remote's database.

Parameters:

Name Type Description Default
command Any

The single command or the list of commands to be deleted.

required
device str | None

Device from which commands will be deleted.

None
Source code in src/hassette/models/entities/remote.py
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
def delete_command(
    self,
    *,
    command: Any,
    device: str | None = None,
) -> Coroutine[Any, Any, None]:
    """Deletes a command or a list of commands from a remote's database.

    Args:
        command: The single command or the list of commands to be deleted.
        device: Device from which commands will be deleted.
    """
    return self.api.call_service(
        domain=self.domain,
        service="delete_command",
        target={"entity_id": self.entity_id},
        command=command,
        device=device,
    )

RemoteEntitySyncFacade

Bases: BaseEntitySyncFacade[RemoteState, str]

Synchronous facade for RemoteEntity service methods.

Source code in src/hassette/models/entities/remote.py
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
class RemoteEntitySyncFacade(BaseEntitySyncFacade[RemoteState, str]):
    """Synchronous facade for RemoteEntity service methods."""

    def turn_on(
        self,
        *,
        activity: str | None = None,
    ) -> None:
        """Sends the turn on command.

        Args:
            activity: Activity ID or activity name to be started.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="turn_on",
            target={"entity_id": self.entity.entity_id},
            activity=activity,
        )

    def toggle(self) -> None:
        """Sends the toggle command."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="toggle",
            target={"entity_id": self.entity.entity_id},
        )

    def turn_off(self) -> None:
        """Sends the turn off command."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="turn_off",
            target={"entity_id": self.entity.entity_id},
        )

    def send_command(
        self,
        *,
        command: Any,
        delay_secs: float | None = None,
        device: str | None = None,
        hold_secs: float | None = None,
        num_repeats: int | None = None,
    ) -> None:
        """Sends a command or a list of commands to a device.

        Args:
            command: A single command or a list of commands to send.
            delay_secs: The time you want to wait in between repeated commands.
            device: Device ID to send command to.
            hold_secs: The time you want to have it held before the release is send.
            num_repeats: The number of times you want to repeat the commands.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="send_command",
            target={"entity_id": self.entity.entity_id},
            command=command,
            delay_secs=delay_secs,
            device=device,
            hold_secs=hold_secs,
            num_repeats=num_repeats,
        )

    def learn_command(
        self,
        *,
        alternative: bool | None = None,
        command: Any | None = None,
        command_type: RemoteCommandType | None = None,
        device: str | None = None,
        timeout: int | None = None,
    ) -> None:
        """Teaches a remote a command or list of commands from a device.

        Args:
            alternative: If code must be stored as an alternative. This is useful for discrete codes. Discrete codes are
                used for toggles that only perform one function. For example, a code to only turn a device on. If it is
                on already, sending the code won't change the state.
            command: A single command or a list of commands to learn.
            command_type: The type of command to be learned.
            device: Device ID to learn command from.
            timeout: Timeout for the command to be learned.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="learn_command",
            target={"entity_id": self.entity.entity_id},
            alternative=alternative,
            command=command,
            command_type=command_type,
            device=device,
            timeout=timeout,
        )

    def delete_command(
        self,
        *,
        command: Any,
        device: str | None = None,
    ) -> None:
        """Deletes a command or a list of commands from a remote's database.

        Args:
            command: The single command or the list of commands to be deleted.
            device: Device from which commands will be deleted.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="delete_command",
            target={"entity_id": self.entity.entity_id},
            command=command,
            device=device,
        )

turn_on(*, activity: str | None = None) -> None

Sends the turn on command.

Parameters:

Name Type Description Default
activity str | None

Activity ID or activity name to be started.

None
Source code in src/hassette/models/entities/remote.py
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
def turn_on(
    self,
    *,
    activity: str | None = None,
) -> None:
    """Sends the turn on command.

    Args:
        activity: Activity ID or activity name to be started.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="turn_on",
        target={"entity_id": self.entity.entity_id},
        activity=activity,
    )

toggle() -> None

Sends the toggle command.

Source code in src/hassette/models/entities/remote.py
156
157
158
159
160
161
162
def toggle(self) -> None:
    """Sends the toggle command."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="toggle",
        target={"entity_id": self.entity.entity_id},
    )

turn_off() -> None

Sends the turn off command.

Source code in src/hassette/models/entities/remote.py
164
165
166
167
168
169
170
def turn_off(self) -> None:
    """Sends the turn off command."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="turn_off",
        target={"entity_id": self.entity.entity_id},
    )

send_command(*, command: Any, delay_secs: float | None = None, device: str | None = None, hold_secs: float | None = None, num_repeats: int | None = None) -> None

Sends a command or a list of commands to a device.

Parameters:

Name Type Description Default
command Any

A single command or a list of commands to send.

required
delay_secs float | None

The time you want to wait in between repeated commands.

None
device str | None

Device ID to send command to.

None
hold_secs float | None

The time you want to have it held before the release is send.

None
num_repeats int | None

The number of times you want to repeat the commands.

None
Source code in src/hassette/models/entities/remote.py
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
def send_command(
    self,
    *,
    command: Any,
    delay_secs: float | None = None,
    device: str | None = None,
    hold_secs: float | None = None,
    num_repeats: int | None = None,
) -> None:
    """Sends a command or a list of commands to a device.

    Args:
        command: A single command or a list of commands to send.
        delay_secs: The time you want to wait in between repeated commands.
        device: Device ID to send command to.
        hold_secs: The time you want to have it held before the release is send.
        num_repeats: The number of times you want to repeat the commands.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="send_command",
        target={"entity_id": self.entity.entity_id},
        command=command,
        delay_secs=delay_secs,
        device=device,
        hold_secs=hold_secs,
        num_repeats=num_repeats,
    )

learn_command(*, alternative: bool | None = None, command: Any | None = None, command_type: RemoteCommandType | None = None, device: str | None = None, timeout: int | None = None) -> None

Teaches a remote a command or list of commands from a device.

Parameters:

Name Type Description Default
alternative bool | None

If code must be stored as an alternative. This is useful for discrete codes. Discrete codes are used for toggles that only perform one function. For example, a code to only turn a device on. If it is on already, sending the code won't change the state.

None
command Any | None

A single command or a list of commands to learn.

None
command_type RemoteCommandType | None

The type of command to be learned.

None
device str | None

Device ID to learn command from.

None
timeout int | None

Timeout for the command to be learned.

None
Source code in src/hassette/models/entities/remote.py
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
def learn_command(
    self,
    *,
    alternative: bool | None = None,
    command: Any | None = None,
    command_type: RemoteCommandType | None = None,
    device: str | None = None,
    timeout: int | None = None,
) -> None:
    """Teaches a remote a command or list of commands from a device.

    Args:
        alternative: If code must be stored as an alternative. This is useful for discrete codes. Discrete codes are
            used for toggles that only perform one function. For example, a code to only turn a device on. If it is
            on already, sending the code won't change the state.
        command: A single command or a list of commands to learn.
        command_type: The type of command to be learned.
        device: Device ID to learn command from.
        timeout: Timeout for the command to be learned.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="learn_command",
        target={"entity_id": self.entity.entity_id},
        alternative=alternative,
        command=command,
        command_type=command_type,
        device=device,
        timeout=timeout,
    )

delete_command(*, command: Any, device: str | None = None) -> None

Deletes a command or a list of commands from a remote's database.

Parameters:

Name Type Description Default
command Any

The single command or the list of commands to be deleted.

required
device str | None

Device from which commands will be deleted.

None
Source code in src/hassette/models/entities/remote.py
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
def delete_command(
    self,
    *,
    command: Any,
    device: str | None = None,
) -> None:
    """Deletes a command or a list of commands from a remote's database.

    Args:
        command: The single command or the list of commands to be deleted.
        device: Device from which commands will be deleted.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="delete_command",
        target={"entity_id": self.entity.entity_id},
        command=command,
        device=device,
    )

ScriptEntity

Bases: BaseEntity[ScriptState, str]

Source code in src/hassette/models/entities/script.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
class ScriptEntity(BaseEntity[ScriptState, str]):
    @property
    def attributes(self) -> ScriptAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "ScriptEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(ScriptEntitySyncFacade)

    def turn_on(self) -> Coroutine[Any, Any, None]:
        """Runs the sequence of actions defined in a script."""
        return self.api.call_service(
            domain=self.domain,
            service="turn_on",
            target={"entity_id": self.entity_id},
        )

    def turn_off(self) -> Coroutine[Any, Any, None]:
        """Stops a running script."""
        return self.api.call_service(
            domain=self.domain,
            service="turn_off",
            target={"entity_id": self.entity_id},
        )

    def toggle(self) -> Coroutine[Any, Any, None]:
        """Starts a script if it isn't running, stops it otherwise."""
        return self.api.call_service(
            domain=self.domain,
            service="toggle",
            target={"entity_id": self.entity_id},
        )

sync: ScriptEntitySyncFacade property

Return the typed synchronous facade for this entity.

turn_on() -> Coroutine[Any, Any, None]

Runs the sequence of actions defined in a script.

Source code in src/hassette/models/entities/script.py
20
21
22
23
24
25
26
def turn_on(self) -> Coroutine[Any, Any, None]:
    """Runs the sequence of actions defined in a script."""
    return self.api.call_service(
        domain=self.domain,
        service="turn_on",
        target={"entity_id": self.entity_id},
    )

turn_off() -> Coroutine[Any, Any, None]

Stops a running script.

Source code in src/hassette/models/entities/script.py
28
29
30
31
32
33
34
def turn_off(self) -> Coroutine[Any, Any, None]:
    """Stops a running script."""
    return self.api.call_service(
        domain=self.domain,
        service="turn_off",
        target={"entity_id": self.entity_id},
    )

toggle() -> Coroutine[Any, Any, None]

Starts a script if it isn't running, stops it otherwise.

Source code in src/hassette/models/entities/script.py
36
37
38
39
40
41
42
def toggle(self) -> Coroutine[Any, Any, None]:
    """Starts a script if it isn't running, stops it otherwise."""
    return self.api.call_service(
        domain=self.domain,
        service="toggle",
        target={"entity_id": self.entity_id},
    )

ScriptEntitySyncFacade

Bases: BaseEntitySyncFacade[ScriptState, str]

Synchronous facade for ScriptEntity service methods.

Source code in src/hassette/models/entities/script.py
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
class ScriptEntitySyncFacade(BaseEntitySyncFacade[ScriptState, str]):
    """Synchronous facade for ScriptEntity service methods."""

    def turn_on(self) -> None:
        """Runs the sequence of actions defined in a script."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="turn_on",
            target={"entity_id": self.entity.entity_id},
        )

    def turn_off(self) -> None:
        """Stops a running script."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="turn_off",
            target={"entity_id": self.entity.entity_id},
        )

    def toggle(self) -> None:
        """Starts a script if it isn't running, stops it otherwise."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="toggle",
            target={"entity_id": self.entity.entity_id},
        )

turn_on() -> None

Runs the sequence of actions defined in a script.

Source code in src/hassette/models/entities/script.py
48
49
50
51
52
53
54
def turn_on(self) -> None:
    """Runs the sequence of actions defined in a script."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="turn_on",
        target={"entity_id": self.entity.entity_id},
    )

turn_off() -> None

Stops a running script.

Source code in src/hassette/models/entities/script.py
56
57
58
59
60
61
62
def turn_off(self) -> None:
    """Stops a running script."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="turn_off",
        target={"entity_id": self.entity.entity_id},
    )

toggle() -> None

Starts a script if it isn't running, stops it otherwise.

Source code in src/hassette/models/entities/script.py
64
65
66
67
68
69
70
def toggle(self) -> None:
    """Starts a script if it isn't running, stops it otherwise."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="toggle",
        target={"entity_id": self.entity.entity_id},
    )

SelectEntity

Bases: BaseEntity[SelectState, str]

Source code in src/hassette/models/entities/select.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
class SelectEntity(BaseEntity[SelectState, str]):
    @property
    def attributes(self) -> SelectAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "SelectEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(SelectEntitySyncFacade)

    def select_first(self) -> Coroutine[Any, Any, None]:
        """Selects the first option of a select."""
        return self.api.call_service(
            domain=self.domain,
            service="select_first",
            target={"entity_id": self.entity_id},
        )

    def select_last(self) -> Coroutine[Any, Any, None]:
        """Selects the last option of a select."""
        return self.api.call_service(
            domain=self.domain,
            service="select_last",
            target={"entity_id": self.entity_id},
        )

    def select_next(
        self,
        *,
        cycle: bool | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Selects the next option of a select.

        Args:
            cycle: If the option should cycle from the last to the first.
        """
        return self.api.call_service(
            domain=self.domain,
            service="select_next",
            target={"entity_id": self.entity_id},
            cycle=cycle,
        )

    def select_option(
        self,
        *,
        option: str,
    ) -> Coroutine[Any, Any, None]:
        """Selects an option of a select.

        Args:
            option: Option to be selected.
        """
        return self.api.call_service(
            domain=self.domain,
            service="select_option",
            target={"entity_id": self.entity_id},
            option=option,
        )

    def select_previous(
        self,
        *,
        cycle: bool | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Selects the previous option of a select.

        Args:
            cycle: If the option should cycle from the first to the last.
        """
        return self.api.call_service(
            domain=self.domain,
            service="select_previous",
            target={"entity_id": self.entity_id},
            cycle=cycle,
        )

sync: SelectEntitySyncFacade property

Return the typed synchronous facade for this entity.

select_first() -> Coroutine[Any, Any, None]

Selects the first option of a select.

Source code in src/hassette/models/entities/select.py
20
21
22
23
24
25
26
def select_first(self) -> Coroutine[Any, Any, None]:
    """Selects the first option of a select."""
    return self.api.call_service(
        domain=self.domain,
        service="select_first",
        target={"entity_id": self.entity_id},
    )

select_last() -> Coroutine[Any, Any, None]

Selects the last option of a select.

Source code in src/hassette/models/entities/select.py
28
29
30
31
32
33
34
def select_last(self) -> Coroutine[Any, Any, None]:
    """Selects the last option of a select."""
    return self.api.call_service(
        domain=self.domain,
        service="select_last",
        target={"entity_id": self.entity_id},
    )

select_next(*, cycle: bool | None = None) -> Coroutine[Any, Any, None]

Selects the next option of a select.

Parameters:

Name Type Description Default
cycle bool | None

If the option should cycle from the last to the first.

None
Source code in src/hassette/models/entities/select.py
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
def select_next(
    self,
    *,
    cycle: bool | None = None,
) -> Coroutine[Any, Any, None]:
    """Selects the next option of a select.

    Args:
        cycle: If the option should cycle from the last to the first.
    """
    return self.api.call_service(
        domain=self.domain,
        service="select_next",
        target={"entity_id": self.entity_id},
        cycle=cycle,
    )

select_option(*, option: str) -> Coroutine[Any, Any, None]

Selects an option of a select.

Parameters:

Name Type Description Default
option str

Option to be selected.

required
Source code in src/hassette/models/entities/select.py
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
def select_option(
    self,
    *,
    option: str,
) -> Coroutine[Any, Any, None]:
    """Selects an option of a select.

    Args:
        option: Option to be selected.
    """
    return self.api.call_service(
        domain=self.domain,
        service="select_option",
        target={"entity_id": self.entity_id},
        option=option,
    )

select_previous(*, cycle: bool | None = None) -> Coroutine[Any, Any, None]

Selects the previous option of a select.

Parameters:

Name Type Description Default
cycle bool | None

If the option should cycle from the first to the last.

None
Source code in src/hassette/models/entities/select.py
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
def select_previous(
    self,
    *,
    cycle: bool | None = None,
) -> Coroutine[Any, Any, None]:
    """Selects the previous option of a select.

    Args:
        cycle: If the option should cycle from the first to the last.
    """
    return self.api.call_service(
        domain=self.domain,
        service="select_previous",
        target={"entity_id": self.entity_id},
        cycle=cycle,
    )

SelectEntitySyncFacade

Bases: BaseEntitySyncFacade[SelectState, str]

Synchronous facade for SelectEntity service methods.

Source code in src/hassette/models/entities/select.py
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
class SelectEntitySyncFacade(BaseEntitySyncFacade[SelectState, str]):
    """Synchronous facade for SelectEntity service methods."""

    def select_first(self) -> None:
        """Selects the first option of a select."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="select_first",
            target={"entity_id": self.entity.entity_id},
        )

    def select_last(self) -> None:
        """Selects the last option of a select."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="select_last",
            target={"entity_id": self.entity.entity_id},
        )

    def select_next(
        self,
        *,
        cycle: bool | None = None,
    ) -> None:
        """Selects the next option of a select.

        Args:
            cycle: If the option should cycle from the last to the first.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="select_next",
            target={"entity_id": self.entity.entity_id},
            cycle=cycle,
        )

    def select_option(
        self,
        *,
        option: str,
    ) -> None:
        """Selects an option of a select.

        Args:
            option: Option to be selected.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="select_option",
            target={"entity_id": self.entity.entity_id},
            option=option,
        )

    def select_previous(
        self,
        *,
        cycle: bool | None = None,
    ) -> None:
        """Selects the previous option of a select.

        Args:
            cycle: If the option should cycle from the first to the last.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="select_previous",
            target={"entity_id": self.entity.entity_id},
            cycle=cycle,
        )

select_first() -> None

Selects the first option of a select.

Source code in src/hassette/models/entities/select.py
91
92
93
94
95
96
97
def select_first(self) -> None:
    """Selects the first option of a select."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="select_first",
        target={"entity_id": self.entity.entity_id},
    )

select_last() -> None

Selects the last option of a select.

Source code in src/hassette/models/entities/select.py
 99
100
101
102
103
104
105
def select_last(self) -> None:
    """Selects the last option of a select."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="select_last",
        target={"entity_id": self.entity.entity_id},
    )

select_next(*, cycle: bool | None = None) -> None

Selects the next option of a select.

Parameters:

Name Type Description Default
cycle bool | None

If the option should cycle from the last to the first.

None
Source code in src/hassette/models/entities/select.py
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
def select_next(
    self,
    *,
    cycle: bool | None = None,
) -> None:
    """Selects the next option of a select.

    Args:
        cycle: If the option should cycle from the last to the first.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="select_next",
        target={"entity_id": self.entity.entity_id},
        cycle=cycle,
    )

select_option(*, option: str) -> None

Selects an option of a select.

Parameters:

Name Type Description Default
option str

Option to be selected.

required
Source code in src/hassette/models/entities/select.py
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
def select_option(
    self,
    *,
    option: str,
) -> None:
    """Selects an option of a select.

    Args:
        option: Option to be selected.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="select_option",
        target={"entity_id": self.entity.entity_id},
        option=option,
    )

select_previous(*, cycle: bool | None = None) -> None

Selects the previous option of a select.

Parameters:

Name Type Description Default
cycle bool | None

If the option should cycle from the first to the last.

None
Source code in src/hassette/models/entities/select.py
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
def select_previous(
    self,
    *,
    cycle: bool | None = None,
) -> None:
    """Selects the previous option of a select.

    Args:
        cycle: If the option should cycle from the first to the last.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="select_previous",
        target={"entity_id": self.entity.entity_id},
        cycle=cycle,
    )

SirenEntity

Bases: BaseEntity[SirenState, str]

Source code in src/hassette/models/entities/siren.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
class SirenEntity(BaseEntity[SirenState, str]):
    @property
    def attributes(self) -> SirenAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "SirenEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(SirenEntitySyncFacade)

    def turn_on(
        self,
        *,
        duration: str | None = None,
        tone: str | None = None,
        volume_level: float | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Turns on a siren.

        Args:
            duration: Number of seconds the sound is played. Must be supported by the integration.
            tone: The tone to emit. When `available_tones` property is a map, either the key or the value can be used.
                Must be supported by the integration.
            volume_level: The volume. 0 is inaudible, 1 is the maximum volume. Must be supported by the integration.
        """
        return self.api.call_service(
            domain=self.domain,
            service="turn_on",
            target={"entity_id": self.entity_id},
            duration=duration,
            tone=tone,
            volume_level=volume_level,
        )

    def turn_off(self) -> Coroutine[Any, Any, None]:
        """Turns off a siren."""
        return self.api.call_service(
            domain=self.domain,
            service="turn_off",
            target={"entity_id": self.entity_id},
        )

    def toggle(self) -> Coroutine[Any, Any, None]:
        """Toggles a siren on/off."""
        return self.api.call_service(
            domain=self.domain,
            service="toggle",
            target={"entity_id": self.entity_id},
        )

sync: SirenEntitySyncFacade property

Return the typed synchronous facade for this entity.

turn_on(*, duration: str | None = None, tone: str | None = None, volume_level: float | None = None) -> Coroutine[Any, Any, None]

Turns on a siren.

Parameters:

Name Type Description Default
duration str | None

Number of seconds the sound is played. Must be supported by the integration.

None
tone str | None

The tone to emit. When available_tones property is a map, either the key or the value can be used. Must be supported by the integration.

None
volume_level float | None

The volume. 0 is inaudible, 1 is the maximum volume. Must be supported by the integration.

None
Source code in src/hassette/models/entities/siren.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
def turn_on(
    self,
    *,
    duration: str | None = None,
    tone: str | None = None,
    volume_level: float | None = None,
) -> Coroutine[Any, Any, None]:
    """Turns on a siren.

    Args:
        duration: Number of seconds the sound is played. Must be supported by the integration.
        tone: The tone to emit. When `available_tones` property is a map, either the key or the value can be used.
            Must be supported by the integration.
        volume_level: The volume. 0 is inaudible, 1 is the maximum volume. Must be supported by the integration.
    """
    return self.api.call_service(
        domain=self.domain,
        service="turn_on",
        target={"entity_id": self.entity_id},
        duration=duration,
        tone=tone,
        volume_level=volume_level,
    )

turn_off() -> Coroutine[Any, Any, None]

Turns off a siren.

Source code in src/hassette/models/entities/siren.py
44
45
46
47
48
49
50
def turn_off(self) -> Coroutine[Any, Any, None]:
    """Turns off a siren."""
    return self.api.call_service(
        domain=self.domain,
        service="turn_off",
        target={"entity_id": self.entity_id},
    )

toggle() -> Coroutine[Any, Any, None]

Toggles a siren on/off.

Source code in src/hassette/models/entities/siren.py
52
53
54
55
56
57
58
def toggle(self) -> Coroutine[Any, Any, None]:
    """Toggles a siren on/off."""
    return self.api.call_service(
        domain=self.domain,
        service="toggle",
        target={"entity_id": self.entity_id},
    )

SirenEntitySyncFacade

Bases: BaseEntitySyncFacade[SirenState, str]

Synchronous facade for SirenEntity service methods.

Source code in src/hassette/models/entities/siren.py
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
class SirenEntitySyncFacade(BaseEntitySyncFacade[SirenState, str]):
    """Synchronous facade for SirenEntity service methods."""

    def turn_on(
        self,
        *,
        duration: str | None = None,
        tone: str | None = None,
        volume_level: float | None = None,
    ) -> None:
        """Turns on a siren.

        Args:
            duration: Number of seconds the sound is played. Must be supported by the integration.
            tone: The tone to emit. When `available_tones` property is a map, either the key or the value can be used.
                Must be supported by the integration.
            volume_level: The volume. 0 is inaudible, 1 is the maximum volume. Must be supported by the integration.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="turn_on",
            target={"entity_id": self.entity.entity_id},
            duration=duration,
            tone=tone,
            volume_level=volume_level,
        )

    def turn_off(self) -> None:
        """Turns off a siren."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="turn_off",
            target={"entity_id": self.entity.entity_id},
        )

    def toggle(self) -> None:
        """Toggles a siren on/off."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="toggle",
            target={"entity_id": self.entity.entity_id},
        )

turn_on(*, duration: str | None = None, tone: str | None = None, volume_level: float | None = None) -> None

Turns on a siren.

Parameters:

Name Type Description Default
duration str | None

Number of seconds the sound is played. Must be supported by the integration.

None
tone str | None

The tone to emit. When available_tones property is a map, either the key or the value can be used. Must be supported by the integration.

None
volume_level float | None

The volume. 0 is inaudible, 1 is the maximum volume. Must be supported by the integration.

None
Source code in src/hassette/models/entities/siren.py
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
def turn_on(
    self,
    *,
    duration: str | None = None,
    tone: str | None = None,
    volume_level: float | None = None,
) -> None:
    """Turns on a siren.

    Args:
        duration: Number of seconds the sound is played. Must be supported by the integration.
        tone: The tone to emit. When `available_tones` property is a map, either the key or the value can be used.
            Must be supported by the integration.
        volume_level: The volume. 0 is inaudible, 1 is the maximum volume. Must be supported by the integration.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="turn_on",
        target={"entity_id": self.entity.entity_id},
        duration=duration,
        tone=tone,
        volume_level=volume_level,
    )

turn_off() -> None

Turns off a siren.

Source code in src/hassette/models/entities/siren.py
88
89
90
91
92
93
94
def turn_off(self) -> None:
    """Turns off a siren."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="turn_off",
        target={"entity_id": self.entity.entity_id},
    )

toggle() -> None

Toggles a siren on/off.

Source code in src/hassette/models/entities/siren.py
 96
 97
 98
 99
100
101
102
def toggle(self) -> None:
    """Toggles a siren on/off."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="toggle",
        target={"entity_id": self.entity.entity_id},
    )

SwitchEntity

Bases: BaseEntity[SwitchState, str]

Source code in src/hassette/models/entities/switch.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
class SwitchEntity(BaseEntity[SwitchState, str]):
    @property
    def attributes(self) -> SwitchAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "SwitchEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(SwitchEntitySyncFacade)

    def turn_on(self) -> Coroutine[Any, Any, None]:
        """Turns on a switch."""
        return self.api.call_service(
            domain=self.domain,
            service="turn_on",
            target={"entity_id": self.entity_id},
        )

    def turn_off(self) -> Coroutine[Any, Any, None]:
        """Turns off a switch."""
        return self.api.call_service(
            domain=self.domain,
            service="turn_off",
            target={"entity_id": self.entity_id},
        )

    def toggle(self) -> Coroutine[Any, Any, None]:
        """Toggles a switch on/off."""
        return self.api.call_service(
            domain=self.domain,
            service="toggle",
            target={"entity_id": self.entity_id},
        )

sync: SwitchEntitySyncFacade property

Return the typed synchronous facade for this entity.

turn_on() -> Coroutine[Any, Any, None]

Turns on a switch.

Source code in src/hassette/models/entities/switch.py
20
21
22
23
24
25
26
def turn_on(self) -> Coroutine[Any, Any, None]:
    """Turns on a switch."""
    return self.api.call_service(
        domain=self.domain,
        service="turn_on",
        target={"entity_id": self.entity_id},
    )

turn_off() -> Coroutine[Any, Any, None]

Turns off a switch.

Source code in src/hassette/models/entities/switch.py
28
29
30
31
32
33
34
def turn_off(self) -> Coroutine[Any, Any, None]:
    """Turns off a switch."""
    return self.api.call_service(
        domain=self.domain,
        service="turn_off",
        target={"entity_id": self.entity_id},
    )

toggle() -> Coroutine[Any, Any, None]

Toggles a switch on/off.

Source code in src/hassette/models/entities/switch.py
36
37
38
39
40
41
42
def toggle(self) -> Coroutine[Any, Any, None]:
    """Toggles a switch on/off."""
    return self.api.call_service(
        domain=self.domain,
        service="toggle",
        target={"entity_id": self.entity_id},
    )

SwitchEntitySyncFacade

Bases: BaseEntitySyncFacade[SwitchState, str]

Synchronous facade for SwitchEntity service methods.

Source code in src/hassette/models/entities/switch.py
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
class SwitchEntitySyncFacade(BaseEntitySyncFacade[SwitchState, str]):
    """Synchronous facade for SwitchEntity service methods."""

    def turn_on(self) -> None:
        """Turns on a switch."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="turn_on",
            target={"entity_id": self.entity.entity_id},
        )

    def turn_off(self) -> None:
        """Turns off a switch."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="turn_off",
            target={"entity_id": self.entity.entity_id},
        )

    def toggle(self) -> None:
        """Toggles a switch on/off."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="toggle",
            target={"entity_id": self.entity.entity_id},
        )

turn_on() -> None

Turns on a switch.

Source code in src/hassette/models/entities/switch.py
48
49
50
51
52
53
54
def turn_on(self) -> None:
    """Turns on a switch."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="turn_on",
        target={"entity_id": self.entity.entity_id},
    )

turn_off() -> None

Turns off a switch.

Source code in src/hassette/models/entities/switch.py
56
57
58
59
60
61
62
def turn_off(self) -> None:
    """Turns off a switch."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="turn_off",
        target={"entity_id": self.entity.entity_id},
    )

toggle() -> None

Toggles a switch on/off.

Source code in src/hassette/models/entities/switch.py
64
65
66
67
68
69
70
def toggle(self) -> None:
    """Toggles a switch on/off."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="toggle",
        target={"entity_id": self.entity.entity_id},
    )

TextEntity

Bases: BaseEntity[TextState, str]

Source code in src/hassette/models/entities/text.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
class TextEntity(BaseEntity[TextState, str]):
    @property
    def attributes(self) -> TextAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "TextEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(TextEntitySyncFacade)

    def set_value(
        self,
        *,
        value: str,
    ) -> Coroutine[Any, Any, None]:
        """Sets the value of a text entity.

        Args:
            value: Enter your text.
        """
        return self.api.call_service(
            domain=self.domain,
            service="set_value",
            target={"entity_id": self.entity_id},
            value=value,
        )

sync: TextEntitySyncFacade property

Return the typed synchronous facade for this entity.

set_value(*, value: str) -> Coroutine[Any, Any, None]

Sets the value of a text entity.

Parameters:

Name Type Description Default
value str

Enter your text.

required
Source code in src/hassette/models/entities/text.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
def set_value(
    self,
    *,
    value: str,
) -> Coroutine[Any, Any, None]:
    """Sets the value of a text entity.

    Args:
        value: Enter your text.
    """
    return self.api.call_service(
        domain=self.domain,
        service="set_value",
        target={"entity_id": self.entity_id},
        value=value,
    )

TextEntitySyncFacade

Bases: BaseEntitySyncFacade[TextState, str]

Synchronous facade for TextEntity service methods.

Source code in src/hassette/models/entities/text.py
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
class TextEntitySyncFacade(BaseEntitySyncFacade[TextState, str]):
    """Synchronous facade for TextEntity service methods."""

    def set_value(
        self,
        *,
        value: str,
    ) -> None:
        """Sets the value of a text entity.

        Args:
            value: Enter your text.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="set_value",
            target={"entity_id": self.entity.entity_id},
            value=value,
        )

set_value(*, value: str) -> None

Sets the value of a text entity.

Parameters:

Name Type Description Default
value str

Enter your text.

required
Source code in src/hassette/models/entities/text.py
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
def set_value(
    self,
    *,
    value: str,
) -> None:
    """Sets the value of a text entity.

    Args:
        value: Enter your text.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="set_value",
        target={"entity_id": self.entity.entity_id},
        value=value,
    )

TimeEntity

Bases: BaseEntity[TimeState, str]

Source code in src/hassette/models/entities/time.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
class TimeEntity(BaseEntity[TimeState, str]):
    @property
    def attributes(self) -> TimeAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "TimeEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(TimeEntitySyncFacade)

    def set_value(
        self,
        *,
        time: str,
    ) -> Coroutine[Any, Any, None]:
        """Sets the value of a time entity.

        Args:
            time: The time to set.
        """
        return self.api.call_service(
            domain=self.domain,
            service="set_value",
            target={"entity_id": self.entity_id},
            time=time,
        )

sync: TimeEntitySyncFacade property

Return the typed synchronous facade for this entity.

set_value(*, time: str) -> Coroutine[Any, Any, None]

Sets the value of a time entity.

Parameters:

Name Type Description Default
time str

The time to set.

required
Source code in src/hassette/models/entities/time.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
def set_value(
    self,
    *,
    time: str,
) -> Coroutine[Any, Any, None]:
    """Sets the value of a time entity.

    Args:
        time: The time to set.
    """
    return self.api.call_service(
        domain=self.domain,
        service="set_value",
        target={"entity_id": self.entity_id},
        time=time,
    )

TimeEntitySyncFacade

Bases: BaseEntitySyncFacade[TimeState, str]

Synchronous facade for TimeEntity service methods.

Source code in src/hassette/models/entities/time.py
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
class TimeEntitySyncFacade(BaseEntitySyncFacade[TimeState, str]):
    """Synchronous facade for TimeEntity service methods."""

    def set_value(
        self,
        *,
        time: str,
    ) -> None:
        """Sets the value of a time entity.

        Args:
            time: The time to set.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="set_value",
            target={"entity_id": self.entity.entity_id},
            time=time,
        )

set_value(*, time: str) -> None

Sets the value of a time entity.

Parameters:

Name Type Description Default
time str

The time to set.

required
Source code in src/hassette/models/entities/time.py
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
def set_value(
    self,
    *,
    time: str,
) -> None:
    """Sets the value of a time entity.

    Args:
        time: The time to set.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="set_value",
        target={"entity_id": self.entity.entity_id},
        time=time,
    )

TimerEntity

Bases: BaseEntity[TimerState, str]

Source code in src/hassette/models/entities/timer.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
class TimerEntity(BaseEntity[TimerState, str]):
    @property
    def attributes(self) -> TimerAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "TimerEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(TimerEntitySyncFacade)

    def start(
        self,
        *,
        duration: dict[str, int] | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Starts a timer or restarts it with a provided duration.

        Args:
            duration: Custom duration to restart the timer with.
        """
        return self.api.call_service(
            domain=self.domain,
            service="start",
            target={"entity_id": self.entity_id},
            duration=duration,
        )

    def pause(self) -> Coroutine[Any, Any, None]:
        """Pauses a running timer, retaining the remaining duration for later continuation."""
        return self.api.call_service(
            domain=self.domain,
            service="pause",
            target={"entity_id": self.entity_id},
        )

    def cancel(self) -> Coroutine[Any, Any, None]:
        """Resets a timer's duration to the last known initial value without firing the timer finished event."""
        return self.api.call_service(
            domain=self.domain,
            service="cancel",
            target={"entity_id": self.entity_id},
        )

    def finish(self) -> Coroutine[Any, Any, None]:
        """Finishes a running timer earlier than scheduled."""
        return self.api.call_service(
            domain=self.domain,
            service="finish",
            target={"entity_id": self.entity_id},
        )

    def change(
        self,
        *,
        duration: dict[str, int],
    ) -> Coroutine[Any, Any, None]:
        """Changes a timer by adding or subtracting a given duration.

        Args:
            duration: Duration to add to or subtract from the running timer.
        """
        return self.api.call_service(
            domain=self.domain,
            service="change",
            target={"entity_id": self.entity_id},
            duration=duration,
        )

sync: TimerEntitySyncFacade property

Return the typed synchronous facade for this entity.

start(*, duration: dict[str, int] | None = None) -> Coroutine[Any, Any, None]

Starts a timer or restarts it with a provided duration.

Parameters:

Name Type Description Default
duration dict[str, int] | None

Custom duration to restart the timer with.

None
Source code in src/hassette/models/entities/timer.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
def start(
    self,
    *,
    duration: dict[str, int] | None = None,
) -> Coroutine[Any, Any, None]:
    """Starts a timer or restarts it with a provided duration.

    Args:
        duration: Custom duration to restart the timer with.
    """
    return self.api.call_service(
        domain=self.domain,
        service="start",
        target={"entity_id": self.entity_id},
        duration=duration,
    )

pause() -> Coroutine[Any, Any, None]

Pauses a running timer, retaining the remaining duration for later continuation.

Source code in src/hassette/models/entities/timer.py
37
38
39
40
41
42
43
def pause(self) -> Coroutine[Any, Any, None]:
    """Pauses a running timer, retaining the remaining duration for later continuation."""
    return self.api.call_service(
        domain=self.domain,
        service="pause",
        target={"entity_id": self.entity_id},
    )

cancel() -> Coroutine[Any, Any, None]

Resets a timer's duration to the last known initial value without firing the timer finished event.

Source code in src/hassette/models/entities/timer.py
45
46
47
48
49
50
51
def cancel(self) -> Coroutine[Any, Any, None]:
    """Resets a timer's duration to the last known initial value without firing the timer finished event."""
    return self.api.call_service(
        domain=self.domain,
        service="cancel",
        target={"entity_id": self.entity_id},
    )

finish() -> Coroutine[Any, Any, None]

Finishes a running timer earlier than scheduled.

Source code in src/hassette/models/entities/timer.py
53
54
55
56
57
58
59
def finish(self) -> Coroutine[Any, Any, None]:
    """Finishes a running timer earlier than scheduled."""
    return self.api.call_service(
        domain=self.domain,
        service="finish",
        target={"entity_id": self.entity_id},
    )

change(*, duration: dict[str, int]) -> Coroutine[Any, Any, None]

Changes a timer by adding or subtracting a given duration.

Parameters:

Name Type Description Default
duration dict[str, int]

Duration to add to or subtract from the running timer.

required
Source code in src/hassette/models/entities/timer.py
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
def change(
    self,
    *,
    duration: dict[str, int],
) -> Coroutine[Any, Any, None]:
    """Changes a timer by adding or subtracting a given duration.

    Args:
        duration: Duration to add to or subtract from the running timer.
    """
    return self.api.call_service(
        domain=self.domain,
        service="change",
        target={"entity_id": self.entity_id},
        duration=duration,
    )

TimerEntitySyncFacade

Bases: BaseEntitySyncFacade[TimerState, str]

Synchronous facade for TimerEntity service methods.

Source code in src/hassette/models/entities/timer.py
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
class TimerEntitySyncFacade(BaseEntitySyncFacade[TimerState, str]):
    """Synchronous facade for TimerEntity service methods."""

    def start(
        self,
        *,
        duration: dict[str, int] | None = None,
    ) -> None:
        """Starts a timer or restarts it with a provided duration.

        Args:
            duration: Custom duration to restart the timer with.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="start",
            target={"entity_id": self.entity.entity_id},
            duration=duration,
        )

    def pause(self) -> None:
        """Pauses a running timer, retaining the remaining duration for later continuation."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="pause",
            target={"entity_id": self.entity.entity_id},
        )

    def cancel(self) -> None:
        """Resets a timer's duration to the last known initial value without firing the timer finished event."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="cancel",
            target={"entity_id": self.entity.entity_id},
        )

    def finish(self) -> None:
        """Finishes a running timer earlier than scheduled."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="finish",
            target={"entity_id": self.entity.entity_id},
        )

    def change(
        self,
        *,
        duration: dict[str, int],
    ) -> None:
        """Changes a timer by adding or subtracting a given duration.

        Args:
            duration: Duration to add to or subtract from the running timer.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="change",
            target={"entity_id": self.entity.entity_id},
            duration=duration,
        )

start(*, duration: dict[str, int] | None = None) -> None

Starts a timer or restarts it with a provided duration.

Parameters:

Name Type Description Default
duration dict[str, int] | None

Custom duration to restart the timer with.

None
Source code in src/hassette/models/entities/timer.py
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
def start(
    self,
    *,
    duration: dict[str, int] | None = None,
) -> None:
    """Starts a timer or restarts it with a provided duration.

    Args:
        duration: Custom duration to restart the timer with.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="start",
        target={"entity_id": self.entity.entity_id},
        duration=duration,
    )

pause() -> None

Pauses a running timer, retaining the remaining duration for later continuation.

Source code in src/hassette/models/entities/timer.py
 99
100
101
102
103
104
105
def pause(self) -> None:
    """Pauses a running timer, retaining the remaining duration for later continuation."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="pause",
        target={"entity_id": self.entity.entity_id},
    )

cancel() -> None

Resets a timer's duration to the last known initial value without firing the timer finished event.

Source code in src/hassette/models/entities/timer.py
107
108
109
110
111
112
113
def cancel(self) -> None:
    """Resets a timer's duration to the last known initial value without firing the timer finished event."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="cancel",
        target={"entity_id": self.entity.entity_id},
    )

finish() -> None

Finishes a running timer earlier than scheduled.

Source code in src/hassette/models/entities/timer.py
115
116
117
118
119
120
121
def finish(self) -> None:
    """Finishes a running timer earlier than scheduled."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="finish",
        target={"entity_id": self.entity.entity_id},
    )

change(*, duration: dict[str, int]) -> None

Changes a timer by adding or subtracting a given duration.

Parameters:

Name Type Description Default
duration dict[str, int]

Duration to add to or subtract from the running timer.

required
Source code in src/hassette/models/entities/timer.py
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
def change(
    self,
    *,
    duration: dict[str, int],
) -> None:
    """Changes a timer by adding or subtracting a given duration.

    Args:
        duration: Duration to add to or subtract from the running timer.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="change",
        target={"entity_id": self.entity.entity_id},
        duration=duration,
    )

TodoEntity

Bases: BaseEntity[TodoState, str]

Source code in src/hassette/models/entities/todo.py
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
class TodoEntity(BaseEntity[TodoState, str]):
    @property
    def attributes(self) -> TodoAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "TodoEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(TodoEntitySyncFacade)

    def get_items(
        self,
        *,
        status: list[TodoItemStatus] | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Gets items on a to-do list.

        Args:
            status: Only return to-do items with the specified statuses. Returns not completed actions by default.
        """
        return self.api.call_service(
            domain=self.domain,
            service="get_items",
            target={"entity_id": self.entity_id},
            status=status,
        )

    def add_item(
        self,
        *,
        item: str,
        description: str | None = None,
        due_date: str | None = None,
        due_datetime: str | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Adds a new to-do list item.

        Args:
            item: The name that represents the to-do item.
            description: A more complete description of the to-do item than provided by the item name.
            due_date: The date the to-do item is expected to be completed.
            due_datetime: The date and time the to-do item is expected to be completed.
        """
        return self.api.call_service(
            domain=self.domain,
            service="add_item",
            target={"entity_id": self.entity_id},
            item=item,
            description=description,
            due_date=due_date,
            due_datetime=due_datetime,
        )

    def update_item(
        self,
        *,
        item: str,
        description: str | None = None,
        due_date: str | None = None,
        due_datetime: str | None = None,
        rename: str | None = None,
        status: TodoItemStatus | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Updates an existing to-do list item based on its name or UID.

        Args:
            item: The name/summary of the to-do item. If you have items with duplicate names, you can reference specific
                ones using their UID instead.
            description: A more complete description of the to-do item than provided by the item name.
            due_date: The date the to-do item is expected to be completed.
            due_datetime: The date and time the to-do item is expected to be completed.
            rename: The new name for the to-do item.
            status: A status for the to-do item.
        """
        return self.api.call_service(
            domain=self.domain,
            service="update_item",
            target={"entity_id": self.entity_id},
            item=item,
            description=description,
            due_date=due_date,
            due_datetime=due_datetime,
            rename=rename,
            status=status,
        )

    def remove_item(
        self,
        *,
        item: str,
    ) -> Coroutine[Any, Any, None]:
        """Removes an existing to-do list item by its name or UID.

        Args:
            item: The name/summary of the to-do item. If you have items with duplicate names, you can reference specific
                ones using their UID instead.
        """
        return self.api.call_service(
            domain=self.domain,
            service="remove_item",
            target={"entity_id": self.entity_id},
            item=item,
        )

    def remove_completed_items(self) -> Coroutine[Any, Any, None]:
        """Removes all to-do list items that have been completed."""
        return self.api.call_service(
            domain=self.domain,
            service="remove_completed_items",
            target={"entity_id": self.entity_id},
        )

sync: TodoEntitySyncFacade property

Return the typed synchronous facade for this entity.

get_items(*, status: list[TodoItemStatus] | None = None) -> Coroutine[Any, Any, None]

Gets items on a to-do list.

Parameters:

Name Type Description Default
status list[TodoItemStatus] | None

Only return to-do items with the specified statuses. Returns not completed actions by default.

None
Source code in src/hassette/models/entities/todo.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
def get_items(
    self,
    *,
    status: list[TodoItemStatus] | None = None,
) -> Coroutine[Any, Any, None]:
    """Gets items on a to-do list.

    Args:
        status: Only return to-do items with the specified statuses. Returns not completed actions by default.
    """
    return self.api.call_service(
        domain=self.domain,
        service="get_items",
        target={"entity_id": self.entity_id},
        status=status,
    )

add_item(*, item: str, description: str | None = None, due_date: str | None = None, due_datetime: str | None = None) -> Coroutine[Any, Any, None]

Adds a new to-do list item.

Parameters:

Name Type Description Default
item str

The name that represents the to-do item.

required
description str | None

A more complete description of the to-do item than provided by the item name.

None
due_date str | None

The date the to-do item is expected to be completed.

None
due_datetime str | None

The date and time the to-do item is expected to be completed.

None
Source code in src/hassette/models/entities/todo.py
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
def add_item(
    self,
    *,
    item: str,
    description: str | None = None,
    due_date: str | None = None,
    due_datetime: str | None = None,
) -> Coroutine[Any, Any, None]:
    """Adds a new to-do list item.

    Args:
        item: The name that represents the to-do item.
        description: A more complete description of the to-do item than provided by the item name.
        due_date: The date the to-do item is expected to be completed.
        due_datetime: The date and time the to-do item is expected to be completed.
    """
    return self.api.call_service(
        domain=self.domain,
        service="add_item",
        target={"entity_id": self.entity_id},
        item=item,
        description=description,
        due_date=due_date,
        due_datetime=due_datetime,
    )

update_item(*, item: str, description: str | None = None, due_date: str | None = None, due_datetime: str | None = None, rename: str | None = None, status: TodoItemStatus | None = None) -> Coroutine[Any, Any, None]

Updates an existing to-do list item based on its name or UID.

Parameters:

Name Type Description Default
item str

The name/summary of the to-do item. If you have items with duplicate names, you can reference specific ones using their UID instead.

required
description str | None

A more complete description of the to-do item than provided by the item name.

None
due_date str | None

The date the to-do item is expected to be completed.

None
due_datetime str | None

The date and time the to-do item is expected to be completed.

None
rename str | None

The new name for the to-do item.

None
status TodoItemStatus | None

A status for the to-do item.

None
Source code in src/hassette/models/entities/todo.py
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
def update_item(
    self,
    *,
    item: str,
    description: str | None = None,
    due_date: str | None = None,
    due_datetime: str | None = None,
    rename: str | None = None,
    status: TodoItemStatus | None = None,
) -> Coroutine[Any, Any, None]:
    """Updates an existing to-do list item based on its name or UID.

    Args:
        item: The name/summary of the to-do item. If you have items with duplicate names, you can reference specific
            ones using their UID instead.
        description: A more complete description of the to-do item than provided by the item name.
        due_date: The date the to-do item is expected to be completed.
        due_datetime: The date and time the to-do item is expected to be completed.
        rename: The new name for the to-do item.
        status: A status for the to-do item.
    """
    return self.api.call_service(
        domain=self.domain,
        service="update_item",
        target={"entity_id": self.entity_id},
        item=item,
        description=description,
        due_date=due_date,
        due_datetime=due_datetime,
        rename=rename,
        status=status,
    )

remove_item(*, item: str) -> Coroutine[Any, Any, None]

Removes an existing to-do list item by its name or UID.

Parameters:

Name Type Description Default
item str

The name/summary of the to-do item. If you have items with duplicate names, you can reference specific ones using their UID instead.

required
Source code in src/hassette/models/entities/todo.py
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
def remove_item(
    self,
    *,
    item: str,
) -> Coroutine[Any, Any, None]:
    """Removes an existing to-do list item by its name or UID.

    Args:
        item: The name/summary of the to-do item. If you have items with duplicate names, you can reference specific
            ones using their UID instead.
    """
    return self.api.call_service(
        domain=self.domain,
        service="remove_item",
        target={"entity_id": self.entity_id},
        item=item,
    )

remove_completed_items() -> Coroutine[Any, Any, None]

Removes all to-do list items that have been completed.

Source code in src/hassette/models/entities/todo.py
114
115
116
117
118
119
120
def remove_completed_items(self) -> Coroutine[Any, Any, None]:
    """Removes all to-do list items that have been completed."""
    return self.api.call_service(
        domain=self.domain,
        service="remove_completed_items",
        target={"entity_id": self.entity_id},
    )

TodoEntitySyncFacade

Bases: BaseEntitySyncFacade[TodoState, str]

Synchronous facade for TodoEntity service methods.

Source code in src/hassette/models/entities/todo.py
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
class TodoEntitySyncFacade(BaseEntitySyncFacade[TodoState, str]):
    """Synchronous facade for TodoEntity service methods."""

    def get_items(
        self,
        *,
        status: list[TodoItemStatus] | None = None,
    ) -> None:
        """Gets items on a to-do list.

        Args:
            status: Only return to-do items with the specified statuses. Returns not completed actions by default.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="get_items",
            target={"entity_id": self.entity.entity_id},
            status=status,
        )

    def add_item(
        self,
        *,
        item: str,
        description: str | None = None,
        due_date: str | None = None,
        due_datetime: str | None = None,
    ) -> None:
        """Adds a new to-do list item.

        Args:
            item: The name that represents the to-do item.
            description: A more complete description of the to-do item than provided by the item name.
            due_date: The date the to-do item is expected to be completed.
            due_datetime: The date and time the to-do item is expected to be completed.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="add_item",
            target={"entity_id": self.entity.entity_id},
            item=item,
            description=description,
            due_date=due_date,
            due_datetime=due_datetime,
        )

    def update_item(
        self,
        *,
        item: str,
        description: str | None = None,
        due_date: str | None = None,
        due_datetime: str | None = None,
        rename: str | None = None,
        status: TodoItemStatus | None = None,
    ) -> None:
        """Updates an existing to-do list item based on its name or UID.

        Args:
            item: The name/summary of the to-do item. If you have items with duplicate names, you can reference specific
                ones using their UID instead.
            description: A more complete description of the to-do item than provided by the item name.
            due_date: The date the to-do item is expected to be completed.
            due_datetime: The date and time the to-do item is expected to be completed.
            rename: The new name for the to-do item.
            status: A status for the to-do item.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="update_item",
            target={"entity_id": self.entity.entity_id},
            item=item,
            description=description,
            due_date=due_date,
            due_datetime=due_datetime,
            rename=rename,
            status=status,
        )

    def remove_item(
        self,
        *,
        item: str,
    ) -> None:
        """Removes an existing to-do list item by its name or UID.

        Args:
            item: The name/summary of the to-do item. If you have items with duplicate names, you can reference specific
                ones using their UID instead.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="remove_item",
            target={"entity_id": self.entity.entity_id},
            item=item,
        )

    def remove_completed_items(self) -> None:
        """Removes all to-do list items that have been completed."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="remove_completed_items",
            target={"entity_id": self.entity.entity_id},
        )

get_items(*, status: list[TodoItemStatus] | None = None) -> None

Gets items on a to-do list.

Parameters:

Name Type Description Default
status list[TodoItemStatus] | None

Only return to-do items with the specified statuses. Returns not completed actions by default.

None
Source code in src/hassette/models/entities/todo.py
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
def get_items(
    self,
    *,
    status: list[TodoItemStatus] | None = None,
) -> None:
    """Gets items on a to-do list.

    Args:
        status: Only return to-do items with the specified statuses. Returns not completed actions by default.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="get_items",
        target={"entity_id": self.entity.entity_id},
        status=status,
    )

add_item(*, item: str, description: str | None = None, due_date: str | None = None, due_datetime: str | None = None) -> None

Adds a new to-do list item.

Parameters:

Name Type Description Default
item str

The name that represents the to-do item.

required
description str | None

A more complete description of the to-do item than provided by the item name.

None
due_date str | None

The date the to-do item is expected to be completed.

None
due_datetime str | None

The date and time the to-do item is expected to be completed.

None
Source code in src/hassette/models/entities/todo.py
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
def add_item(
    self,
    *,
    item: str,
    description: str | None = None,
    due_date: str | None = None,
    due_datetime: str | None = None,
) -> None:
    """Adds a new to-do list item.

    Args:
        item: The name that represents the to-do item.
        description: A more complete description of the to-do item than provided by the item name.
        due_date: The date the to-do item is expected to be completed.
        due_datetime: The date and time the to-do item is expected to be completed.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="add_item",
        target={"entity_id": self.entity.entity_id},
        item=item,
        description=description,
        due_date=due_date,
        due_datetime=due_datetime,
    )

update_item(*, item: str, description: str | None = None, due_date: str | None = None, due_datetime: str | None = None, rename: str | None = None, status: TodoItemStatus | None = None) -> None

Updates an existing to-do list item based on its name or UID.

Parameters:

Name Type Description Default
item str

The name/summary of the to-do item. If you have items with duplicate names, you can reference specific ones using their UID instead.

required
description str | None

A more complete description of the to-do item than provided by the item name.

None
due_date str | None

The date the to-do item is expected to be completed.

None
due_datetime str | None

The date and time the to-do item is expected to be completed.

None
rename str | None

The new name for the to-do item.

None
status TodoItemStatus | None

A status for the to-do item.

None
Source code in src/hassette/models/entities/todo.py
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
def update_item(
    self,
    *,
    item: str,
    description: str | None = None,
    due_date: str | None = None,
    due_datetime: str | None = None,
    rename: str | None = None,
    status: TodoItemStatus | None = None,
) -> None:
    """Updates an existing to-do list item based on its name or UID.

    Args:
        item: The name/summary of the to-do item. If you have items with duplicate names, you can reference specific
            ones using their UID instead.
        description: A more complete description of the to-do item than provided by the item name.
        due_date: The date the to-do item is expected to be completed.
        due_datetime: The date and time the to-do item is expected to be completed.
        rename: The new name for the to-do item.
        status: A status for the to-do item.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="update_item",
        target={"entity_id": self.entity.entity_id},
        item=item,
        description=description,
        due_date=due_date,
        due_datetime=due_datetime,
        rename=rename,
        status=status,
    )

remove_item(*, item: str) -> None

Removes an existing to-do list item by its name or UID.

Parameters:

Name Type Description Default
item str

The name/summary of the to-do item. If you have items with duplicate names, you can reference specific ones using their UID instead.

required
Source code in src/hassette/models/entities/todo.py
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
def remove_item(
    self,
    *,
    item: str,
) -> None:
    """Removes an existing to-do list item by its name or UID.

    Args:
        item: The name/summary of the to-do item. If you have items with duplicate names, you can reference specific
            ones using their UID instead.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="remove_item",
        target={"entity_id": self.entity.entity_id},
        item=item,
    )

remove_completed_items() -> None

Removes all to-do list items that have been completed.

Source code in src/hassette/models/entities/todo.py
220
221
222
223
224
225
226
def remove_completed_items(self) -> None:
    """Removes all to-do list items that have been completed."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="remove_completed_items",
        target={"entity_id": self.entity.entity_id},
    )

UpdateEntity

Bases: BaseEntity[UpdateState, str]

Source code in src/hassette/models/entities/update.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
class UpdateEntity(BaseEntity[UpdateState, str]):
    @property
    def attributes(self) -> UpdateAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "UpdateEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(UpdateEntitySyncFacade)

    def install(
        self,
        *,
        backup: bool | None = None,
        version: str | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Installs an update for a device or service.

        Args:
            backup: If supported by the integration, this creates a backup before starting the update.
            version: The version to install. If omitted, the latest version will be installed.
        """
        return self.api.call_service(
            domain=self.domain,
            service="install",
            target={"entity_id": self.entity_id},
            backup=backup,
            version=version,
        )

    def skip(self) -> Coroutine[Any, Any, None]:
        """Marks a currently available update as skipped."""
        return self.api.call_service(
            domain=self.domain,
            service="skip",
            target={"entity_id": self.entity_id},
        )

    def clear_skipped(self) -> Coroutine[Any, Any, None]:
        """Removes the skipped version marker from an update."""
        return self.api.call_service(
            domain=self.domain,
            service="clear_skipped",
            target={"entity_id": self.entity_id},
        )

sync: UpdateEntitySyncFacade property

Return the typed synchronous facade for this entity.

install(*, backup: bool | None = None, version: str | None = None) -> Coroutine[Any, Any, None]

Installs an update for a device or service.

Parameters:

Name Type Description Default
backup bool | None

If supported by the integration, this creates a backup before starting the update.

None
version str | None

The version to install. If omitted, the latest version will be installed.

None
Source code in src/hassette/models/entities/update.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
def install(
    self,
    *,
    backup: bool | None = None,
    version: str | None = None,
) -> Coroutine[Any, Any, None]:
    """Installs an update for a device or service.

    Args:
        backup: If supported by the integration, this creates a backup before starting the update.
        version: The version to install. If omitted, the latest version will be installed.
    """
    return self.api.call_service(
        domain=self.domain,
        service="install",
        target={"entity_id": self.entity_id},
        backup=backup,
        version=version,
    )

skip() -> Coroutine[Any, Any, None]

Marks a currently available update as skipped.

Source code in src/hassette/models/entities/update.py
40
41
42
43
44
45
46
def skip(self) -> Coroutine[Any, Any, None]:
    """Marks a currently available update as skipped."""
    return self.api.call_service(
        domain=self.domain,
        service="skip",
        target={"entity_id": self.entity_id},
    )

clear_skipped() -> Coroutine[Any, Any, None]

Removes the skipped version marker from an update.

Source code in src/hassette/models/entities/update.py
48
49
50
51
52
53
54
def clear_skipped(self) -> Coroutine[Any, Any, None]:
    """Removes the skipped version marker from an update."""
    return self.api.call_service(
        domain=self.domain,
        service="clear_skipped",
        target={"entity_id": self.entity_id},
    )

UpdateEntitySyncFacade

Bases: BaseEntitySyncFacade[UpdateState, str]

Synchronous facade for UpdateEntity service methods.

Source code in src/hassette/models/entities/update.py
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
class UpdateEntitySyncFacade(BaseEntitySyncFacade[UpdateState, str]):
    """Synchronous facade for UpdateEntity service methods."""

    def install(
        self,
        *,
        backup: bool | None = None,
        version: str | None = None,
    ) -> None:
        """Installs an update for a device or service.

        Args:
            backup: If supported by the integration, this creates a backup before starting the update.
            version: The version to install. If omitted, the latest version will be installed.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="install",
            target={"entity_id": self.entity.entity_id},
            backup=backup,
            version=version,
        )

    def skip(self) -> None:
        """Marks a currently available update as skipped."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="skip",
            target={"entity_id": self.entity.entity_id},
        )

    def clear_skipped(self) -> None:
        """Removes the skipped version marker from an update."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="clear_skipped",
            target={"entity_id": self.entity.entity_id},
        )

install(*, backup: bool | None = None, version: str | None = None) -> None

Installs an update for a device or service.

Parameters:

Name Type Description Default
backup bool | None

If supported by the integration, this creates a backup before starting the update.

None
version str | None

The version to install. If omitted, the latest version will be installed.

None
Source code in src/hassette/models/entities/update.py
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
def install(
    self,
    *,
    backup: bool | None = None,
    version: str | None = None,
) -> None:
    """Installs an update for a device or service.

    Args:
        backup: If supported by the integration, this creates a backup before starting the update.
        version: The version to install. If omitted, the latest version will be installed.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="install",
        target={"entity_id": self.entity.entity_id},
        backup=backup,
        version=version,
    )

skip() -> None

Marks a currently available update as skipped.

Source code in src/hassette/models/entities/update.py
80
81
82
83
84
85
86
def skip(self) -> None:
    """Marks a currently available update as skipped."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="skip",
        target={"entity_id": self.entity.entity_id},
    )

clear_skipped() -> None

Removes the skipped version marker from an update.

Source code in src/hassette/models/entities/update.py
88
89
90
91
92
93
94
def clear_skipped(self) -> None:
    """Removes the skipped version marker from an update."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="clear_skipped",
        target={"entity_id": self.entity.entity_id},
    )

VacuumEntity

Bases: BaseEntity[VacuumState, str]

Source code in src/hassette/models/entities/vacuum.py
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
class VacuumEntity(BaseEntity[VacuumState, str]):
    @property
    def attributes(self) -> VacuumAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "VacuumEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(VacuumEntitySyncFacade)

    def turn_on(self) -> Coroutine[Any, Any, None]:
        """Turns on a vacuum cleaner."""
        return self.api.call_service(
            domain=self.domain,
            service="turn_on",
            target={"entity_id": self.entity_id},
        )

    def turn_off(self) -> Coroutine[Any, Any, None]:
        """Turns off a vacuum cleaner."""
        return self.api.call_service(
            domain=self.domain,
            service="turn_off",
            target={"entity_id": self.entity_id},
        )

    def toggle(self) -> Coroutine[Any, Any, None]:
        """Toggles a vacuum cleaner on/off."""
        return self.api.call_service(
            domain=self.domain,
            service="toggle",
            target={"entity_id": self.entity_id},
        )

    def stop(self) -> Coroutine[Any, Any, None]:
        """Stops a vacuum cleaner's current task."""
        return self.api.call_service(
            domain=self.domain,
            service="stop",
            target={"entity_id": self.entity_id},
        )

    def locate(self) -> Coroutine[Any, Any, None]:
        """Locates a vacuum cleaner."""
        return self.api.call_service(
            domain=self.domain,
            service="locate",
            target={"entity_id": self.entity_id},
        )

    def start_pause(self) -> Coroutine[Any, Any, None]:
        """Starts, pauses, or resumes a vacuum cleaner's cleaning task."""
        return self.api.call_service(
            domain=self.domain,
            service="start_pause",
            target={"entity_id": self.entity_id},
        )

    def start(self) -> Coroutine[Any, Any, None]:
        """Starts or resumes a vacuum cleaner's cleaning task."""
        return self.api.call_service(
            domain=self.domain,
            service="start",
            target={"entity_id": self.entity_id},
        )

    def pause(self) -> Coroutine[Any, Any, None]:
        """Pauses a vacuum cleaner's current task."""
        return self.api.call_service(
            domain=self.domain,
            service="pause",
            target={"entity_id": self.entity_id},
        )

    def return_to_base(self) -> Coroutine[Any, Any, None]:
        """Sends a vacuum cleaner back to its dock."""
        return self.api.call_service(
            domain=self.domain,
            service="return_to_base",
            target={"entity_id": self.entity_id},
        )

    def clean_spot(self) -> Coroutine[Any, Any, None]:
        """Tells a vacuum cleaner to do a spot clean-up."""
        return self.api.call_service(
            domain=self.domain,
            service="clean_spot",
            target={"entity_id": self.entity_id},
        )

    def clean_area(
        self,
        *,
        cleaning_area_id: list[str],
    ) -> Coroutine[Any, Any, None]:
        """Tells a vacuum cleaner to clean one or more areas.

        Args:
            cleaning_area_id: Areas to clean.
        """
        return self.api.call_service(
            domain=self.domain,
            service="clean_area",
            target={"entity_id": self.entity_id},
            cleaning_area_id=cleaning_area_id,
        )

    def send_command(
        self,
        *,
        command: str,
        params: Any | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Sends a command to a vacuum cleaner.

        Args:
            command: Command to execute. The commands are integration-specific.
            params: Parameters for the command. The parameters are integration-specific.
        """
        return self.api.call_service(
            domain=self.domain,
            service="send_command",
            target={"entity_id": self.entity_id},
            command=command,
            params=params,
        )

    def set_fan_speed(
        self,
        *,
        fan_speed: str,
    ) -> Coroutine[Any, Any, None]:
        """Sets the fan speed of a vacuum cleaner.

        Args:
            fan_speed: Fan speed. The value depends on the integration. Some integrations have speed steps, like
                'medium'. Some use a percentage, between 0 and 100.
        """
        return self.api.call_service(
            domain=self.domain,
            service="set_fan_speed",
            target={"entity_id": self.entity_id},
            fan_speed=fan_speed,
        )

sync: VacuumEntitySyncFacade property

Return the typed synchronous facade for this entity.

turn_on() -> Coroutine[Any, Any, None]

Turns on a vacuum cleaner.

Source code in src/hassette/models/entities/vacuum.py
20
21
22
23
24
25
26
def turn_on(self) -> Coroutine[Any, Any, None]:
    """Turns on a vacuum cleaner."""
    return self.api.call_service(
        domain=self.domain,
        service="turn_on",
        target={"entity_id": self.entity_id},
    )

turn_off() -> Coroutine[Any, Any, None]

Turns off a vacuum cleaner.

Source code in src/hassette/models/entities/vacuum.py
28
29
30
31
32
33
34
def turn_off(self) -> Coroutine[Any, Any, None]:
    """Turns off a vacuum cleaner."""
    return self.api.call_service(
        domain=self.domain,
        service="turn_off",
        target={"entity_id": self.entity_id},
    )

toggle() -> Coroutine[Any, Any, None]

Toggles a vacuum cleaner on/off.

Source code in src/hassette/models/entities/vacuum.py
36
37
38
39
40
41
42
def toggle(self) -> Coroutine[Any, Any, None]:
    """Toggles a vacuum cleaner on/off."""
    return self.api.call_service(
        domain=self.domain,
        service="toggle",
        target={"entity_id": self.entity_id},
    )

stop() -> Coroutine[Any, Any, None]

Stops a vacuum cleaner's current task.

Source code in src/hassette/models/entities/vacuum.py
44
45
46
47
48
49
50
def stop(self) -> Coroutine[Any, Any, None]:
    """Stops a vacuum cleaner's current task."""
    return self.api.call_service(
        domain=self.domain,
        service="stop",
        target={"entity_id": self.entity_id},
    )

locate() -> Coroutine[Any, Any, None]

Locates a vacuum cleaner.

Source code in src/hassette/models/entities/vacuum.py
52
53
54
55
56
57
58
def locate(self) -> Coroutine[Any, Any, None]:
    """Locates a vacuum cleaner."""
    return self.api.call_service(
        domain=self.domain,
        service="locate",
        target={"entity_id": self.entity_id},
    )

start_pause() -> Coroutine[Any, Any, None]

Starts, pauses, or resumes a vacuum cleaner's cleaning task.

Source code in src/hassette/models/entities/vacuum.py
60
61
62
63
64
65
66
def start_pause(self) -> Coroutine[Any, Any, None]:
    """Starts, pauses, or resumes a vacuum cleaner's cleaning task."""
    return self.api.call_service(
        domain=self.domain,
        service="start_pause",
        target={"entity_id": self.entity_id},
    )

start() -> Coroutine[Any, Any, None]

Starts or resumes a vacuum cleaner's cleaning task.

Source code in src/hassette/models/entities/vacuum.py
68
69
70
71
72
73
74
def start(self) -> Coroutine[Any, Any, None]:
    """Starts or resumes a vacuum cleaner's cleaning task."""
    return self.api.call_service(
        domain=self.domain,
        service="start",
        target={"entity_id": self.entity_id},
    )

pause() -> Coroutine[Any, Any, None]

Pauses a vacuum cleaner's current task.

Source code in src/hassette/models/entities/vacuum.py
76
77
78
79
80
81
82
def pause(self) -> Coroutine[Any, Any, None]:
    """Pauses a vacuum cleaner's current task."""
    return self.api.call_service(
        domain=self.domain,
        service="pause",
        target={"entity_id": self.entity_id},
    )

return_to_base() -> Coroutine[Any, Any, None]

Sends a vacuum cleaner back to its dock.

Source code in src/hassette/models/entities/vacuum.py
84
85
86
87
88
89
90
def return_to_base(self) -> Coroutine[Any, Any, None]:
    """Sends a vacuum cleaner back to its dock."""
    return self.api.call_service(
        domain=self.domain,
        service="return_to_base",
        target={"entity_id": self.entity_id},
    )

clean_spot() -> Coroutine[Any, Any, None]

Tells a vacuum cleaner to do a spot clean-up.

Source code in src/hassette/models/entities/vacuum.py
92
93
94
95
96
97
98
def clean_spot(self) -> Coroutine[Any, Any, None]:
    """Tells a vacuum cleaner to do a spot clean-up."""
    return self.api.call_service(
        domain=self.domain,
        service="clean_spot",
        target={"entity_id": self.entity_id},
    )

clean_area(*, cleaning_area_id: list[str]) -> Coroutine[Any, Any, None]

Tells a vacuum cleaner to clean one or more areas.

Parameters:

Name Type Description Default
cleaning_area_id list[str]

Areas to clean.

required
Source code in src/hassette/models/entities/vacuum.py
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
def clean_area(
    self,
    *,
    cleaning_area_id: list[str],
) -> Coroutine[Any, Any, None]:
    """Tells a vacuum cleaner to clean one or more areas.

    Args:
        cleaning_area_id: Areas to clean.
    """
    return self.api.call_service(
        domain=self.domain,
        service="clean_area",
        target={"entity_id": self.entity_id},
        cleaning_area_id=cleaning_area_id,
    )

send_command(*, command: str, params: Any | None = None) -> Coroutine[Any, Any, None]

Sends a command to a vacuum cleaner.

Parameters:

Name Type Description Default
command str

Command to execute. The commands are integration-specific.

required
params Any | None

Parameters for the command. The parameters are integration-specific.

None
Source code in src/hassette/models/entities/vacuum.py
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
def send_command(
    self,
    *,
    command: str,
    params: Any | None = None,
) -> Coroutine[Any, Any, None]:
    """Sends a command to a vacuum cleaner.

    Args:
        command: Command to execute. The commands are integration-specific.
        params: Parameters for the command. The parameters are integration-specific.
    """
    return self.api.call_service(
        domain=self.domain,
        service="send_command",
        target={"entity_id": self.entity_id},
        command=command,
        params=params,
    )

set_fan_speed(*, fan_speed: str) -> Coroutine[Any, Any, None]

Sets the fan speed of a vacuum cleaner.

Parameters:

Name Type Description Default
fan_speed str

Fan speed. The value depends on the integration. Some integrations have speed steps, like 'medium'. Some use a percentage, between 0 and 100.

required
Source code in src/hassette/models/entities/vacuum.py
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
def set_fan_speed(
    self,
    *,
    fan_speed: str,
) -> Coroutine[Any, Any, None]:
    """Sets the fan speed of a vacuum cleaner.

    Args:
        fan_speed: Fan speed. The value depends on the integration. Some integrations have speed steps, like
            'medium'. Some use a percentage, between 0 and 100.
    """
    return self.api.call_service(
        domain=self.domain,
        service="set_fan_speed",
        target={"entity_id": self.entity_id},
        fan_speed=fan_speed,
    )

VacuumEntitySyncFacade

Bases: BaseEntitySyncFacade[VacuumState, str]

Synchronous facade for VacuumEntity service methods.

Source code in src/hassette/models/entities/vacuum.py
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
class VacuumEntitySyncFacade(BaseEntitySyncFacade[VacuumState, str]):
    """Synchronous facade for VacuumEntity service methods."""

    def turn_on(self) -> None:
        """Turns on a vacuum cleaner."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="turn_on",
            target={"entity_id": self.entity.entity_id},
        )

    def turn_off(self) -> None:
        """Turns off a vacuum cleaner."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="turn_off",
            target={"entity_id": self.entity.entity_id},
        )

    def toggle(self) -> None:
        """Toggles a vacuum cleaner on/off."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="toggle",
            target={"entity_id": self.entity.entity_id},
        )

    def stop(self) -> None:
        """Stops a vacuum cleaner's current task."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="stop",
            target={"entity_id": self.entity.entity_id},
        )

    def locate(self) -> None:
        """Locates a vacuum cleaner."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="locate",
            target={"entity_id": self.entity.entity_id},
        )

    def start_pause(self) -> None:
        """Starts, pauses, or resumes a vacuum cleaner's cleaning task."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="start_pause",
            target={"entity_id": self.entity.entity_id},
        )

    def start(self) -> None:
        """Starts or resumes a vacuum cleaner's cleaning task."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="start",
            target={"entity_id": self.entity.entity_id},
        )

    def pause(self) -> None:
        """Pauses a vacuum cleaner's current task."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="pause",
            target={"entity_id": self.entity.entity_id},
        )

    def return_to_base(self) -> None:
        """Sends a vacuum cleaner back to its dock."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="return_to_base",
            target={"entity_id": self.entity.entity_id},
        )

    def clean_spot(self) -> None:
        """Tells a vacuum cleaner to do a spot clean-up."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="clean_spot",
            target={"entity_id": self.entity.entity_id},
        )

    def clean_area(
        self,
        *,
        cleaning_area_id: list[str],
    ) -> None:
        """Tells a vacuum cleaner to clean one or more areas.

        Args:
            cleaning_area_id: Areas to clean.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="clean_area",
            target={"entity_id": self.entity.entity_id},
            cleaning_area_id=cleaning_area_id,
        )

    def send_command(
        self,
        *,
        command: str,
        params: Any | None = None,
    ) -> None:
        """Sends a command to a vacuum cleaner.

        Args:
            command: Command to execute. The commands are integration-specific.
            params: Parameters for the command. The parameters are integration-specific.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="send_command",
            target={"entity_id": self.entity.entity_id},
            command=command,
            params=params,
        )

    def set_fan_speed(
        self,
        *,
        fan_speed: str,
    ) -> None:
        """Sets the fan speed of a vacuum cleaner.

        Args:
            fan_speed: Fan speed. The value depends on the integration. Some integrations have speed steps, like
                'medium'. Some use a percentage, between 0 and 100.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="set_fan_speed",
            target={"entity_id": self.entity.entity_id},
            fan_speed=fan_speed,
        )

turn_on() -> None

Turns on a vacuum cleaner.

Source code in src/hassette/models/entities/vacuum.py
159
160
161
162
163
164
165
def turn_on(self) -> None:
    """Turns on a vacuum cleaner."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="turn_on",
        target={"entity_id": self.entity.entity_id},
    )

turn_off() -> None

Turns off a vacuum cleaner.

Source code in src/hassette/models/entities/vacuum.py
167
168
169
170
171
172
173
def turn_off(self) -> None:
    """Turns off a vacuum cleaner."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="turn_off",
        target={"entity_id": self.entity.entity_id},
    )

toggle() -> None

Toggles a vacuum cleaner on/off.

Source code in src/hassette/models/entities/vacuum.py
175
176
177
178
179
180
181
def toggle(self) -> None:
    """Toggles a vacuum cleaner on/off."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="toggle",
        target={"entity_id": self.entity.entity_id},
    )

stop() -> None

Stops a vacuum cleaner's current task.

Source code in src/hassette/models/entities/vacuum.py
183
184
185
186
187
188
189
def stop(self) -> None:
    """Stops a vacuum cleaner's current task."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="stop",
        target={"entity_id": self.entity.entity_id},
    )

locate() -> None

Locates a vacuum cleaner.

Source code in src/hassette/models/entities/vacuum.py
191
192
193
194
195
196
197
def locate(self) -> None:
    """Locates a vacuum cleaner."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="locate",
        target={"entity_id": self.entity.entity_id},
    )

start_pause() -> None

Starts, pauses, or resumes a vacuum cleaner's cleaning task.

Source code in src/hassette/models/entities/vacuum.py
199
200
201
202
203
204
205
def start_pause(self) -> None:
    """Starts, pauses, or resumes a vacuum cleaner's cleaning task."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="start_pause",
        target={"entity_id": self.entity.entity_id},
    )

start() -> None

Starts or resumes a vacuum cleaner's cleaning task.

Source code in src/hassette/models/entities/vacuum.py
207
208
209
210
211
212
213
def start(self) -> None:
    """Starts or resumes a vacuum cleaner's cleaning task."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="start",
        target={"entity_id": self.entity.entity_id},
    )

pause() -> None

Pauses a vacuum cleaner's current task.

Source code in src/hassette/models/entities/vacuum.py
215
216
217
218
219
220
221
def pause(self) -> None:
    """Pauses a vacuum cleaner's current task."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="pause",
        target={"entity_id": self.entity.entity_id},
    )

return_to_base() -> None

Sends a vacuum cleaner back to its dock.

Source code in src/hassette/models/entities/vacuum.py
223
224
225
226
227
228
229
def return_to_base(self) -> None:
    """Sends a vacuum cleaner back to its dock."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="return_to_base",
        target={"entity_id": self.entity.entity_id},
    )

clean_spot() -> None

Tells a vacuum cleaner to do a spot clean-up.

Source code in src/hassette/models/entities/vacuum.py
231
232
233
234
235
236
237
def clean_spot(self) -> None:
    """Tells a vacuum cleaner to do a spot clean-up."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="clean_spot",
        target={"entity_id": self.entity.entity_id},
    )

clean_area(*, cleaning_area_id: list[str]) -> None

Tells a vacuum cleaner to clean one or more areas.

Parameters:

Name Type Description Default
cleaning_area_id list[str]

Areas to clean.

required
Source code in src/hassette/models/entities/vacuum.py
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
def clean_area(
    self,
    *,
    cleaning_area_id: list[str],
) -> None:
    """Tells a vacuum cleaner to clean one or more areas.

    Args:
        cleaning_area_id: Areas to clean.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="clean_area",
        target={"entity_id": self.entity.entity_id},
        cleaning_area_id=cleaning_area_id,
    )

send_command(*, command: str, params: Any | None = None) -> None

Sends a command to a vacuum cleaner.

Parameters:

Name Type Description Default
command str

Command to execute. The commands are integration-specific.

required
params Any | None

Parameters for the command. The parameters are integration-specific.

None
Source code in src/hassette/models/entities/vacuum.py
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
def send_command(
    self,
    *,
    command: str,
    params: Any | None = None,
) -> None:
    """Sends a command to a vacuum cleaner.

    Args:
        command: Command to execute. The commands are integration-specific.
        params: Parameters for the command. The parameters are integration-specific.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="send_command",
        target={"entity_id": self.entity.entity_id},
        command=command,
        params=params,
    )

set_fan_speed(*, fan_speed: str) -> None

Sets the fan speed of a vacuum cleaner.

Parameters:

Name Type Description Default
fan_speed str

Fan speed. The value depends on the integration. Some integrations have speed steps, like 'medium'. Some use a percentage, between 0 and 100.

required
Source code in src/hassette/models/entities/vacuum.py
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
def set_fan_speed(
    self,
    *,
    fan_speed: str,
) -> None:
    """Sets the fan speed of a vacuum cleaner.

    Args:
        fan_speed: Fan speed. The value depends on the integration. Some integrations have speed steps, like
            'medium'. Some use a percentage, between 0 and 100.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="set_fan_speed",
        target={"entity_id": self.entity.entity_id},
        fan_speed=fan_speed,
    )

WaterHeaterEntity

Bases: BaseEntity[WaterHeaterState, str]

Source code in src/hassette/models/entities/water_heater.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
class WaterHeaterEntity(BaseEntity[WaterHeaterState, str]):
    @property
    def attributes(self) -> WaterHeaterAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "WaterHeaterEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(WaterHeaterEntitySyncFacade)

    def set_away_mode(
        self,
        *,
        away_mode: bool,
    ) -> Coroutine[Any, Any, None]:
        """Sets the away mode of a water heater.

        Args:
            away_mode: New value of away mode.
        """
        return self.api.call_service(
            domain=self.domain,
            service="set_away_mode",
            target={"entity_id": self.entity_id},
            away_mode=away_mode,
        )

    def set_temperature(
        self,
        *,
        temperature: float,
        operation_mode: str | None = None,
    ) -> Coroutine[Any, Any, None]:
        """Sets the target temperature of a water heater.

        Args:
            temperature: New target temperature for the water heater.
            operation_mode: New value of the operation mode. For a list of possible modes, refer to the integration
                documentation.
        """
        return self.api.call_service(
            domain=self.domain,
            service="set_temperature",
            target={"entity_id": self.entity_id},
            temperature=temperature,
            operation_mode=operation_mode,
        )

    def set_operation_mode(
        self,
        *,
        operation_mode: str,
    ) -> Coroutine[Any, Any, None]:
        """Sets the operation mode of a water heater.

        Args:
            operation_mode: New value of the operation mode. For a list of possible modes, refer to the integration
                documentation.
        """
        return self.api.call_service(
            domain=self.domain,
            service="set_operation_mode",
            target={"entity_id": self.entity_id},
            operation_mode=operation_mode,
        )

    def turn_on(self) -> Coroutine[Any, Any, None]:
        """Turns on a water heater."""
        return self.api.call_service(
            domain=self.domain,
            service="turn_on",
            target={"entity_id": self.entity_id},
        )

    def turn_off(self) -> Coroutine[Any, Any, None]:
        """Turns off a water heater."""
        return self.api.call_service(
            domain=self.domain,
            service="turn_off",
            target={"entity_id": self.entity_id},
        )

sync: WaterHeaterEntitySyncFacade property

Return the typed synchronous facade for this entity.

set_away_mode(*, away_mode: bool) -> Coroutine[Any, Any, None]

Sets the away mode of a water heater.

Parameters:

Name Type Description Default
away_mode bool

New value of away mode.

required
Source code in src/hassette/models/entities/water_heater.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
def set_away_mode(
    self,
    *,
    away_mode: bool,
) -> Coroutine[Any, Any, None]:
    """Sets the away mode of a water heater.

    Args:
        away_mode: New value of away mode.
    """
    return self.api.call_service(
        domain=self.domain,
        service="set_away_mode",
        target={"entity_id": self.entity_id},
        away_mode=away_mode,
    )

set_temperature(*, temperature: float, operation_mode: str | None = None) -> Coroutine[Any, Any, None]

Sets the target temperature of a water heater.

Parameters:

Name Type Description Default
temperature float

New target temperature for the water heater.

required
operation_mode str | None

New value of the operation mode. For a list of possible modes, refer to the integration documentation.

None
Source code in src/hassette/models/entities/water_heater.py
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
def set_temperature(
    self,
    *,
    temperature: float,
    operation_mode: str | None = None,
) -> Coroutine[Any, Any, None]:
    """Sets the target temperature of a water heater.

    Args:
        temperature: New target temperature for the water heater.
        operation_mode: New value of the operation mode. For a list of possible modes, refer to the integration
            documentation.
    """
    return self.api.call_service(
        domain=self.domain,
        service="set_temperature",
        target={"entity_id": self.entity_id},
        temperature=temperature,
        operation_mode=operation_mode,
    )

set_operation_mode(*, operation_mode: str) -> Coroutine[Any, Any, None]

Sets the operation mode of a water heater.

Parameters:

Name Type Description Default
operation_mode str

New value of the operation mode. For a list of possible modes, refer to the integration documentation.

required
Source code in src/hassette/models/entities/water_heater.py
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
def set_operation_mode(
    self,
    *,
    operation_mode: str,
) -> Coroutine[Any, Any, None]:
    """Sets the operation mode of a water heater.

    Args:
        operation_mode: New value of the operation mode. For a list of possible modes, refer to the integration
            documentation.
    """
    return self.api.call_service(
        domain=self.domain,
        service="set_operation_mode",
        target={"entity_id": self.entity_id},
        operation_mode=operation_mode,
    )

turn_on() -> Coroutine[Any, Any, None]

Turns on a water heater.

Source code in src/hassette/models/entities/water_heater.py
76
77
78
79
80
81
82
def turn_on(self) -> Coroutine[Any, Any, None]:
    """Turns on a water heater."""
    return self.api.call_service(
        domain=self.domain,
        service="turn_on",
        target={"entity_id": self.entity_id},
    )

turn_off() -> Coroutine[Any, Any, None]

Turns off a water heater.

Source code in src/hassette/models/entities/water_heater.py
84
85
86
87
88
89
90
def turn_off(self) -> Coroutine[Any, Any, None]:
    """Turns off a water heater."""
    return self.api.call_service(
        domain=self.domain,
        service="turn_off",
        target={"entity_id": self.entity_id},
    )

WaterHeaterEntitySyncFacade

Bases: BaseEntitySyncFacade[WaterHeaterState, str]

Synchronous facade for WaterHeaterEntity service methods.

Source code in src/hassette/models/entities/water_heater.py
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
class WaterHeaterEntitySyncFacade(BaseEntitySyncFacade[WaterHeaterState, str]):
    """Synchronous facade for WaterHeaterEntity service methods."""

    def set_away_mode(
        self,
        *,
        away_mode: bool,
    ) -> None:
        """Sets the away mode of a water heater.

        Args:
            away_mode: New value of away mode.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="set_away_mode",
            target={"entity_id": self.entity.entity_id},
            away_mode=away_mode,
        )

    def set_temperature(
        self,
        *,
        temperature: float,
        operation_mode: str | None = None,
    ) -> None:
        """Sets the target temperature of a water heater.

        Args:
            temperature: New target temperature for the water heater.
            operation_mode: New value of the operation mode. For a list of possible modes, refer to the integration
                documentation.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="set_temperature",
            target={"entity_id": self.entity.entity_id},
            temperature=temperature,
            operation_mode=operation_mode,
        )

    def set_operation_mode(
        self,
        *,
        operation_mode: str,
    ) -> None:
        """Sets the operation mode of a water heater.

        Args:
            operation_mode: New value of the operation mode. For a list of possible modes, refer to the integration
                documentation.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="set_operation_mode",
            target={"entity_id": self.entity.entity_id},
            operation_mode=operation_mode,
        )

    def turn_on(self) -> None:
        """Turns on a water heater."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="turn_on",
            target={"entity_id": self.entity.entity_id},
        )

    def turn_off(self) -> None:
        """Turns off a water heater."""
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="turn_off",
            target={"entity_id": self.entity.entity_id},
        )

set_away_mode(*, away_mode: bool) -> None

Sets the away mode of a water heater.

Parameters:

Name Type Description Default
away_mode bool

New value of away mode.

required
Source code in src/hassette/models/entities/water_heater.py
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
def set_away_mode(
    self,
    *,
    away_mode: bool,
) -> None:
    """Sets the away mode of a water heater.

    Args:
        away_mode: New value of away mode.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="set_away_mode",
        target={"entity_id": self.entity.entity_id},
        away_mode=away_mode,
    )

set_temperature(*, temperature: float, operation_mode: str | None = None) -> None

Sets the target temperature of a water heater.

Parameters:

Name Type Description Default
temperature float

New target temperature for the water heater.

required
operation_mode str | None

New value of the operation mode. For a list of possible modes, refer to the integration documentation.

None
Source code in src/hassette/models/entities/water_heater.py
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
def set_temperature(
    self,
    *,
    temperature: float,
    operation_mode: str | None = None,
) -> None:
    """Sets the target temperature of a water heater.

    Args:
        temperature: New target temperature for the water heater.
        operation_mode: New value of the operation mode. For a list of possible modes, refer to the integration
            documentation.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="set_temperature",
        target={"entity_id": self.entity.entity_id},
        temperature=temperature,
        operation_mode=operation_mode,
    )

set_operation_mode(*, operation_mode: str) -> None

Sets the operation mode of a water heater.

Parameters:

Name Type Description Default
operation_mode str

New value of the operation mode. For a list of possible modes, refer to the integration documentation.

required
Source code in src/hassette/models/entities/water_heater.py
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
def set_operation_mode(
    self,
    *,
    operation_mode: str,
) -> None:
    """Sets the operation mode of a water heater.

    Args:
        operation_mode: New value of the operation mode. For a list of possible modes, refer to the integration
            documentation.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="set_operation_mode",
        target={"entity_id": self.entity.entity_id},
        operation_mode=operation_mode,
    )

turn_on() -> None

Turns on a water heater.

Source code in src/hassette/models/entities/water_heater.py
152
153
154
155
156
157
158
def turn_on(self) -> None:
    """Turns on a water heater."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="turn_on",
        target={"entity_id": self.entity.entity_id},
    )

turn_off() -> None

Turns off a water heater.

Source code in src/hassette/models/entities/water_heater.py
160
161
162
163
164
165
166
def turn_off(self) -> None:
    """Turns off a water heater."""
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="turn_off",
        target={"entity_id": self.entity.entity_id},
    )

WeatherEntity

Bases: BaseEntity[WeatherState, str]

Source code in src/hassette/models/entities/weather.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
class WeatherEntity(BaseEntity[WeatherState, str]):
    @property
    def attributes(self) -> WeatherAttributes:
        return self.state.attributes

    @property
    def sync(self) -> "WeatherEntitySyncFacade":
        """Return the typed synchronous facade for this entity."""
        return self._get_or_create_sync(WeatherEntitySyncFacade)

    def get_forecast(
        self,
        *,
        type: WeatherType,
    ) -> Coroutine[Any, Any, None]:
        """Retrieves the forecast from a weather service.

        Args:
            type: The scope of the weather forecast.
        """
        return self.api.call_service(
            domain=self.domain,
            service="get_forecast",
            target={"entity_id": self.entity_id},
            type=type,
        )

    def get_forecasts(
        self,
        *,
        type: WeatherType,
    ) -> Coroutine[Any, Any, None]:
        """Retrieves the forecasts from one or more weather services.

        Args:
            type: The scope of the weather forecast.
        """
        return self.api.call_service(
            domain=self.domain,
            service="get_forecasts",
            target={"entity_id": self.entity_id},
            type=type,
        )

sync: WeatherEntitySyncFacade property

Return the typed synchronous facade for this entity.

get_forecast(*, type: WeatherType) -> Coroutine[Any, Any, None]

Retrieves the forecast from a weather service.

Parameters:

Name Type Description Default
type WeatherType

The scope of the weather forecast.

required
Source code in src/hassette/models/entities/weather.py
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
def get_forecast(
    self,
    *,
    type: WeatherType,
) -> Coroutine[Any, Any, None]:
    """Retrieves the forecast from a weather service.

    Args:
        type: The scope of the weather forecast.
    """
    return self.api.call_service(
        domain=self.domain,
        service="get_forecast",
        target={"entity_id": self.entity_id},
        type=type,
    )

get_forecasts(*, type: WeatherType) -> Coroutine[Any, Any, None]

Retrieves the forecasts from one or more weather services.

Parameters:

Name Type Description Default
type WeatherType

The scope of the weather forecast.

required
Source code in src/hassette/models/entities/weather.py
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
def get_forecasts(
    self,
    *,
    type: WeatherType,
) -> Coroutine[Any, Any, None]:
    """Retrieves the forecasts from one or more weather services.

    Args:
        type: The scope of the weather forecast.
    """
    return self.api.call_service(
        domain=self.domain,
        service="get_forecasts",
        target={"entity_id": self.entity_id},
        type=type,
    )

WeatherEntitySyncFacade

Bases: BaseEntitySyncFacade[WeatherState, str]

Synchronous facade for WeatherEntity service methods.

Source code in src/hassette/models/entities/weather.py
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
class WeatherEntitySyncFacade(BaseEntitySyncFacade[WeatherState, str]):
    """Synchronous facade for WeatherEntity service methods."""

    def get_forecast(
        self,
        *,
        type: WeatherType,
    ) -> None:
        """Retrieves the forecast from a weather service.

        Args:
            type: The scope of the weather forecast.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="get_forecast",
            target={"entity_id": self.entity.entity_id},
            type=type,
        )

    def get_forecasts(
        self,
        *,
        type: WeatherType,
    ) -> None:
        """Retrieves the forecasts from one or more weather services.

        Args:
            type: The scope of the weather forecast.
        """
        self.entity.api.sync.call_service(
            domain=self.entity.domain,
            service="get_forecasts",
            target={"entity_id": self.entity.entity_id},
            type=type,
        )

get_forecast(*, type: WeatherType) -> None

Retrieves the forecast from a weather service.

Parameters:

Name Type Description Default
type WeatherType

The scope of the weather forecast.

required
Source code in src/hassette/models/entities/weather.py
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
def get_forecast(
    self,
    *,
    type: WeatherType,
) -> None:
    """Retrieves the forecast from a weather service.

    Args:
        type: The scope of the weather forecast.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="get_forecast",
        target={"entity_id": self.entity.entity_id},
        type=type,
    )

get_forecasts(*, type: WeatherType) -> None

Retrieves the forecasts from one or more weather services.

Parameters:

Name Type Description Default
type WeatherType

The scope of the weather forecast.

required
Source code in src/hassette/models/entities/weather.py
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
def get_forecasts(
    self,
    *,
    type: WeatherType,
) -> None:
    """Retrieves the forecasts from one or more weather services.

    Args:
        type: The scope of the weather forecast.
    """
    self.entity.api.sync.call_service(
        domain=self.entity.domain,
        service="get_forecasts",
        target={"entity_id": self.entity.entity_id},
        type=type,
    )