Skip to content

Index

AirQualityState

Bases: NumericBaseState

Representation of a Home Assistant air_quality state.

See: https://www.home-assistant.io/integrations/air_quality/

Source code in src/hassette/models/states/air_quality.py
26
27
28
29
30
31
32
33
34
class AirQualityState(NumericBaseState):
    """Representation of a Home Assistant air_quality state.

    See: https://www.home-assistant.io/integrations/air_quality/
    """

    domain: Literal["air_quality"]

    attributes: AirQualityAttributes

AlarmControlPanelState

Bases: StringBaseState

Representation of a Home Assistant alarm_control_panel state.

See: https://www.home-assistant.io/integrations/alarm_control_panel/

Source code in src/hassette/models/states/alarm_control_panel.py
67
68
69
70
71
72
73
74
75
class AlarmControlPanelState(StringBaseState):
    """Representation of a Home Assistant alarm_control_panel state.

    See: https://www.home-assistant.io/integrations/alarm_control_panel/
    """

    domain: Literal["alarm_control_panel"]

    attributes: AlarmControlPanelAttributes

AssistSatelliteState

Bases: StringBaseState

Representation of a Home Assistant assist_satellite state.

See: https://www.home-assistant.io/integrations/assist_satellite/

Source code in src/hassette/models/states/assist_satellite.py
 6
 7
 8
 9
10
11
12
class AssistSatelliteState(StringBaseState):
    """Representation of a Home Assistant assist_satellite state.

    See: https://www.home-assistant.io/integrations/assist_satellite/
    """

    domain: Literal["assist_satellite"]

AutomationState

Bases: BoolBaseState

Representation of a Home Assistant automation state.

See: https://www.home-assistant.io/integrations/automation/

Source code in src/hassette/models/states/automation.py
24
25
26
27
28
29
30
31
32
class AutomationState(BoolBaseState):
    """Representation of a Home Assistant automation state.

    See: https://www.home-assistant.io/integrations/automation/
    """

    domain: Literal["automation"]

    attributes: AutomationAttributes

AttributesBase

Bases: BaseModel

Represents the attributes of a HomeAssistant state.

Source code in src/hassette/models/states/base.py
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
class AttributesBase(BaseModel):
    """Represents the attributes of a HomeAssistant state."""

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

    icon: str | None = Field(default=None, repr=False)
    """The icon of the entity."""

    friendly_name: str | None = Field(default=None)
    """A friendly name for the entity."""

    device_class: str | None = Field(default=None)
    """The device class of the entity."""

    entity_id: list[str] | None = Field(default=None)
    """List of entity IDs if this is a group entity."""

    supported_features: int | float | None = Field(default=None)
    """Bitfield of supported features."""

    @property
    def extras(self) -> dict[str, Any]:
        """Integration-specific attributes not covered by the typed model."""
        return self.model_extra or {}

    def extra(self, key: str, default: Any = None) -> Any:
        """Get a single integration-specific attribute with a default."""
        return self.extras.get(key, default)

    def has_feature(self, flag: int) -> bool:
        """Check whether *flag* is set in :pyattr:`supported_features`."""
        if self.supported_features is None:
            return False
        return bool(int(self.supported_features) & flag)

icon: str | None = Field(default=None, repr=False) class-attribute instance-attribute

The icon of the entity.

friendly_name: str | None = Field(default=None) class-attribute instance-attribute

A friendly name for the entity.

device_class: str | None = Field(default=None) class-attribute instance-attribute

The device class of the entity.

entity_id: list[str] | None = Field(default=None) class-attribute instance-attribute

List of entity IDs if this is a group entity.

supported_features: int | float | None = Field(default=None) class-attribute instance-attribute

Bitfield of supported features.

extras: dict[str, Any] property

Integration-specific attributes not covered by the typed model.

extra(key: str, default: Any = None) -> Any

Get a single integration-specific attribute with a default.

Source code in src/hassette/models/states/base.py
58
59
60
def extra(self, key: str, default: Any = None) -> Any:
    """Get a single integration-specific attribute with a default."""
    return self.extras.get(key, default)

has_feature(flag: int) -> bool

Check whether flag is set in :pyattr:supported_features.

Source code in src/hassette/models/states/base.py
62
63
64
65
66
def has_feature(self, flag: int) -> bool:
    """Check whether *flag* is set in :pyattr:`supported_features`."""
    if self.supported_features is None:
        return False
    return bool(int(self.supported_features) & flag)

BaseState

Bases: BaseModel, Generic[StateValueT]

Represents a Home Assistant state object.

Source code in src/hassette/models/states/base.py
 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
class BaseState(BaseModel, Generic[StateValueT]):
    """Represents a Home Assistant state object."""

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

    value_type: ClassVar[type | tuple[type, ...]] = (str, type(None))
    """The Python type of the state value, e.g. bool for BinarySensorState."""

    domain: str
    """The domain of the entity, e.g. 'light', 'sensor', etc."""

    entity_id: str = Field(...)
    """The full entity ID, e.g. 'light.living_room'."""

    last_changed: ZonedDateTime | None = Field(None)
    """Time the state changed in the state machine, not updated when only attributes change."""

    last_reported: ZonedDateTime | None = Field(None)
    """Time the state was written to the state machine, updated regardless of any changes to the state or
    state attributes.
    """

    last_updated: ZonedDateTime | None = Field(None)
    """Time the state or state attributes changed in the state machine, not updated if neither state nor state
    attributes changed.
    """

    context: Context = Field(repr=False)
    """The context of the state change."""

    is_unknown: bool = Field(default=False)
    """Whether the state is 'unknown'."""

    is_unavailable: bool = Field(default=False)
    """Whether the state is 'unavailable'."""

    value: StateValueT = Field(..., validation_alias=AliasChoices("state", "value"))
    """The state value, e.g. 'on', 'off', 23.5, etc."""

    attributes: AttributesBase = Field(...)
    """The attributes of the state."""

    @property
    def is_group(self) -> bool:
        """Whether this entity is a group entity (i.e. has multiple entity_ids)."""
        if not self.attributes:
            return False

        if not hasattr(self.attributes, "entity_id"):
            return False

        if not isinstance(self.attributes.entity_id, list):  # pyright: ignore[reportAttributeAccessIssue]
            return False

        return len(self.attributes.entity_id) > 1  # pyright: ignore[reportAttributeAccessIssue]

    @property
    def extras(self) -> dict[str, Any]:
        """Extra fields not covered by the typed state model."""
        return self.model_extra or {}

    def extra(self, key: str, default: Any = None) -> Any:
        """Get a single extra field with a default."""
        return self.extras.get(key, default)

    def __init_subclass__(cls, **kwargs):
        super().__init_subclass__(**kwargs)
        with suppress(NoDomainAnnotationError):
            register_state_converter(cls, domain=cls.get_domain())

    @field_validator("last_changed", "last_reported", "last_updated", mode="before")
    @classmethod
    def _validate_datetime_fields(cls, value):
        if value is None:
            return None
        if isinstance(value, int | float):
            return convert_utc_timestamp_to_system_tz(value)
        if isinstance(value, str):
            # need to use OffsetDateTime since the value is +00:00, not Z or a timezone
            return convert_datetime_str_to_system_tz(value)

        return value

    @model_validator(mode="before")
    @classmethod
    def _validate_domain_and_state(cls, values):
        if not isinstance(values, dict):
            LOGGER.warning("Expected values to be a dict, got %s", type(values).__name__, stacklevel=2)
            return values

        values = dict(values)

        entity_id = values.get("entity_id")
        if entity_id:
            domain = entity_id.split(".")[0]
            values["domain"] = domain

        state = values.get("state")
        if state == "unknown":
            values["is_unknown"] = True
            values["state"] = state = None
        elif state == "unavailable":
            values["is_unavailable"] = True
            values["state"] = state = None

        try:
            values["state"] = TYPE_REGISTRY.convert(state, cls.value_type)
        except UnableToConvertValueError as e:
            LOGGER.error(
                "Unable to convert state value %r for entity %s: %s", state, values.get("entity_id"), e, stacklevel=2
            )
            raise

        return values

    @classmethod
    def get_domain(cls) -> str:
        """Returns the domain string for this state class, extracted from the domain field annotation."""

        fields = cls.model_fields
        domain_field = fields.get("domain")
        if not domain_field:
            raise NoDomainAnnotationError(cls)

        annotations = get_annotations(cls)
        annotation = annotations.get("domain")
        if annotation is None:
            raise NoDomainAnnotationError(cls)

        args = get_args(annotation)
        if not args:
            raise NoDomainAnnotationError(cls)

        domain = args[0]
        if not isinstance(domain, str):
            raise NoDomainAnnotationError(cls)

        return domain

value_type: type | tuple[type, ...] = (str, type(None)) class-attribute

The Python type of the state value, e.g. bool for BinarySensorState.

domain: str instance-attribute

The domain of the entity, e.g. 'light', 'sensor', etc.

entity_id: str = Field(...) class-attribute instance-attribute

The full entity ID, e.g. 'light.living_room'.

last_changed: ZonedDateTime | None = Field(None) class-attribute instance-attribute

Time the state changed in the state machine, not updated when only attributes change.

last_reported: ZonedDateTime | None = Field(None) class-attribute instance-attribute

Time the state was written to the state machine, updated regardless of any changes to the state or state attributes.

last_updated: ZonedDateTime | None = Field(None) class-attribute instance-attribute

Time the state or state attributes changed in the state machine, not updated if neither state nor state attributes changed.

context: Context = Field(repr=False) class-attribute instance-attribute

The context of the state change.

is_unknown: bool = Field(default=False) class-attribute instance-attribute

Whether the state is 'unknown'.

is_unavailable: bool = Field(default=False) class-attribute instance-attribute

Whether the state is 'unavailable'.

value: StateValueT = Field(..., validation_alias=(AliasChoices('state', 'value'))) class-attribute instance-attribute

The state value, e.g. 'on', 'off', 23.5, etc.

attributes: AttributesBase = Field(...) class-attribute instance-attribute

The attributes of the state.

is_group: bool property

Whether this entity is a group entity (i.e. has multiple entity_ids).

extras: dict[str, Any] property

Extra fields not covered by the typed state model.

extra(key: str, default: Any = None) -> Any

Get a single extra field with a default.

Source code in src/hassette/models/states/base.py
130
131
132
def extra(self, key: str, default: Any = None) -> Any:
    """Get a single extra field with a default."""
    return self.extras.get(key, default)

get_domain() -> str classmethod

Returns the domain string for this state class, extracted from the domain field annotation.

Source code in src/hassette/models/states/base.py
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
@classmethod
def get_domain(cls) -> str:
    """Returns the domain string for this state class, extracted from the domain field annotation."""

    fields = cls.model_fields
    domain_field = fields.get("domain")
    if not domain_field:
        raise NoDomainAnnotationError(cls)

    annotations = get_annotations(cls)
    annotation = annotations.get("domain")
    if annotation is None:
        raise NoDomainAnnotationError(cls)

    args = get_args(annotation)
    if not args:
        raise NoDomainAnnotationError(cls)

    domain = args[0]
    if not isinstance(domain, str):
        raise NoDomainAnnotationError(cls)

    return domain

BoolBaseState

Bases: BaseState[bool | None]

Base class for boolean states.

Valid state values are True, False, or None.

Will convert string values "on" and "off" to boolean True and False.

Source code in src/hassette/models/states/base.py
233
234
235
236
237
238
239
240
241
class BoolBaseState(BaseState[bool | None]):
    """Base class for boolean states.

    Valid state values are True, False, or None.

    Will convert string values "on" and "off" to boolean True and False.
    """

    value_type: ClassVar[type[Any] | tuple[type[Any], ...]] = (bool, type(None))

Context

Bases: BaseModel

Represents the context of a Home Assistant event.

Source code in src/hassette/models/states/base.py
18
19
20
21
22
23
24
25
26
27
28
29
30
class Context(BaseModel):
    """Represents the context of a Home Assistant event."""

    model_config = ConfigDict(frozen=True)

    id: str | None = Field(default=None)
    """The context ID of the event."""

    parent_id: str | None = Field(default=None)
    """The parent context ID of the event, if any."""

    user_id: str | None = Field(default=None)
    """The user ID for who triggered the event."""

id: str | None = Field(default=None) class-attribute instance-attribute

The context ID of the event.

parent_id: str | None = Field(default=None) class-attribute instance-attribute

The parent context ID of the event, if any.

user_id: str | None = Field(default=None) class-attribute instance-attribute

The user ID for who triggered the event.

DateTimeBaseState

Bases: BaseState[ZonedDateTime | PlainDateTime | Date | None]

Base class for datetime states.

Valid state values are ZonedDateTime, PlainDateTime, Date, or None.

Source code in src/hassette/models/states/base.py
215
216
217
218
219
220
221
class DateTimeBaseState(BaseState[ZonedDateTime | PlainDateTime | Date | None]):
    """Base class for datetime states.

    Valid state values are ZonedDateTime, PlainDateTime, Date, or None.
    """

    value_type: ClassVar[type[Any] | tuple[type[Any], ...]] = (ZonedDateTime, PlainDateTime, Date, type(None))

NumericBaseState

Bases: BaseState[int | float | Decimal | None]

Base class for numeric states.

Will convert string values to float, int, or Decimal. Valid state values are int, float, Decimal, or None.

Source code in src/hassette/models/states/base.py
244
245
246
247
248
249
250
251
class NumericBaseState(BaseState[int | float | Decimal | None]):
    """Base class for numeric states.

    Will convert string values to float, int, or Decimal.
    Valid state values are int, float, Decimal, or None.
    """

    value_type: ClassVar[type[Any] | tuple[type[Any], ...]] = (int, float, Decimal, type(None))

StringBaseState

Bases: BaseState[str | None]

Base class for string states.

Source code in src/hassette/models/states/base.py
209
210
211
212
class StringBaseState(BaseState[str | None]):
    """Base class for string states."""

    value_type: ClassVar[type[Any] | tuple[type[Any], ...]] = (str, type(None))

TimeBaseState

Bases: BaseState[Time | None]

Base class for Time states.

Valid state values are Time or None.

Source code in src/hassette/models/states/base.py
224
225
226
227
228
229
230
class TimeBaseState(BaseState[Time | None]):
    """Base class for Time states.

    Valid state values are Time or None.
    """

    value_type: ClassVar[type[Any] | tuple[type[Any], ...]] = (Time, type(None))

BinarySensorState

Bases: BoolBaseState

Representation of a Home Assistant binary_sensor state.

See: https://www.home-assistant.io/integrations/binary_sensor/

Source code in src/hassette/models/states/binary_sensor.py
45
46
47
48
49
50
51
52
53
class BinarySensorState(BoolBaseState):
    """Representation of a Home Assistant binary_sensor state.

    See: https://www.home-assistant.io/integrations/binary_sensor/
    """

    domain: Literal["binary_sensor"]

    attributes: BinarySensorAttributes

ButtonState

Bases: StringBaseState

Representation of a Home Assistant button state.

See: https://www.home-assistant.io/integrations/button/

Source code in src/hassette/models/states/button.py
19
20
21
22
23
24
25
26
27
class ButtonState(StringBaseState):
    """Representation of a Home Assistant button state.

    See: https://www.home-assistant.io/integrations/button/
    """

    domain: Literal["button"]

    attributes: ButtonAttributes

CalendarState

Bases: StringBaseState

Representation of a Home Assistant calendar state.

See: https://www.home-assistant.io/integrations/calendar/

Source code in src/hassette/models/states/calendar.py
18
19
20
21
22
23
24
25
26
class CalendarState(StringBaseState):
    """Representation of a Home Assistant calendar state.

    See: https://www.home-assistant.io/integrations/calendar/
    """

    domain: Literal["calendar"]

    attributes: CalendarAttributes

CameraState

Bases: StringBaseState

Representation of a Home Assistant camera state.

See: https://www.home-assistant.io/integrations/camera/

Source code in src/hassette/models/states/camera.py
44
45
46
47
48
49
50
51
52
class CameraState(StringBaseState):
    """Representation of a Home Assistant camera state.

    See: https://www.home-assistant.io/integrations/camera/
    """

    domain: Literal["camera"]

    attributes: CameraAttributes

ClimateState

Bases: StringBaseState

Representation of a Home Assistant climate state.

See: https://www.home-assistant.io/integrations/climate/

Source code in src/hassette/models/states/climate.py
106
107
108
109
110
111
112
113
114
class ClimateState(StringBaseState):
    """Representation of a Home Assistant climate state.

    See: https://www.home-assistant.io/integrations/climate/
    """

    domain: Literal["climate"]

    attributes: ClimateAttributes

CounterState

Bases: NumericBaseState

Representation of a Home Assistant counter state.

See: https://www.home-assistant.io/integrations/counter/

Note

CounterState represents the live runtime value of a counter entity. For the stored configuration (initial, minimum, maximum, step, restore), use :class:hassette.models.helpers.CounterRecord via Api.list_counters/create_counter/update_counter.

Source code in src/hassette/models/states/counter.py
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
class CounterState(NumericBaseState):
    """Representation of a Home Assistant counter state.

    See: https://www.home-assistant.io/integrations/counter/

    Note:
        ``CounterState`` represents the *live runtime value* of a counter
        entity. For the stored configuration (``initial``, ``minimum``,
        ``maximum``, ``step``, ``restore``), use
        :class:`hassette.models.helpers.CounterRecord` via
        ``Api.list_counters``/``create_counter``/``update_counter``.
    """

    domain: Literal["counter"]

    attributes: CounterAttributes

CoverState

Bases: StringBaseState

Representation of a Home Assistant cover state.

See: https://www.home-assistant.io/integrations/cover/

Source code in src/hassette/models/states/cover.py
81
82
83
84
85
86
87
88
89
class CoverState(StringBaseState):
    """Representation of a Home Assistant cover state.

    See: https://www.home-assistant.io/integrations/cover/
    """

    domain: Literal["cover"]

    attributes: CoverAttributes

DateState

Bases: StringBaseState

Representation of a Home Assistant date state.

See: https://www.home-assistant.io/integrations/date/

Source code in src/hassette/models/states/date.py
13
14
15
16
17
18
19
20
21
class DateState(StringBaseState):
    """Representation of a Home Assistant date state.

    See: https://www.home-assistant.io/integrations/date/
    """

    domain: Literal["date"]

    attributes: DateAttributes

DateTimeState

Bases: StringBaseState

Representation of a Home Assistant datetime state.

See: https://www.home-assistant.io/integrations/datetime/

Source code in src/hassette/models/states/datetime.py
20
21
22
23
24
25
26
27
28
class DateTimeState(StringBaseState):
    """Representation of a Home Assistant datetime state.

    See: https://www.home-assistant.io/integrations/datetime/
    """

    domain: Literal["datetime"]

    attributes: DateTimeAttributes

DeviceTrackerState

Bases: StringBaseState

Representation of a Home Assistant device_tracker state.

See: https://www.home-assistant.io/integrations/device_tracker/

Source code in src/hassette/models/states/device_tracker.py
20
21
22
23
24
25
26
27
28
class DeviceTrackerState(StringBaseState):
    """Representation of a Home Assistant device_tracker state.

    See: https://www.home-assistant.io/integrations/device_tracker/
    """

    domain: Literal["device_tracker"]

    attributes: DeviceTrackerAttributes

EventState

Bases: StringBaseState

Representation of a Home Assistant event state.

See: https://www.home-assistant.io/integrations/event/

Source code in src/hassette/models/states/event.py
24
25
26
27
28
29
30
31
32
class EventState(StringBaseState):
    """Representation of a Home Assistant event state.

    See: https://www.home-assistant.io/integrations/event/
    """

    domain: Literal["event"]

    attributes: EventAttributes

FanState

Bases: BoolBaseState

Representation of a Home Assistant fan state.

See: https://www.home-assistant.io/integrations/fan/

Source code in src/hassette/models/states/fan.py
51
52
53
54
55
56
57
58
59
class FanState(BoolBaseState):
    """Representation of a Home Assistant fan state.

    See: https://www.home-assistant.io/integrations/fan/
    """

    domain: Literal["fan"]

    attributes: FanAttributes

GeoLocationState

Bases: NumericBaseState

Representation of a Home Assistant geo_location state.

See: https://www.home-assistant.io/integrations/geo_location/

Source code in src/hassette/models/states/geo_location.py
15
16
17
18
19
20
21
22
23
class GeoLocationState(NumericBaseState):
    """Representation of a Home Assistant geo_location state.

    See: https://www.home-assistant.io/integrations/geo_location/
    """

    domain: Literal["geo_location"]

    attributes: GeoLocationAttributes

HumidifierState

Bases: BoolBaseState

Representation of a Home Assistant humidifier state.

See: https://www.home-assistant.io/integrations/humidifier/

Source code in src/hassette/models/states/humidifier.py
41
42
43
44
45
46
47
48
49
class HumidifierState(BoolBaseState):
    """Representation of a Home Assistant humidifier state.

    See: https://www.home-assistant.io/integrations/humidifier/
    """

    domain: Literal["humidifier"]

    attributes: HumidifierAttributes

ImageState

Bases: StringBaseState

Representation of a Home Assistant image state.

See: https://www.home-assistant.io/integrations/image/

Source code in src/hassette/models/states/image.py
23
24
25
26
27
28
29
30
31
class ImageState(StringBaseState):
    """Representation of a Home Assistant image state.

    See: https://www.home-assistant.io/integrations/image/
    """

    domain: Literal["image"]

    attributes: ImageAttributes

ImageProcessingState

Bases: StringBaseState

Representation of a Home Assistant image_processing state.

See: https://www.home-assistant.io/integrations/image_processing/

Source code in src/hassette/models/states/image_processing.py
15
16
17
18
19
20
21
22
23
class ImageProcessingState(StringBaseState):
    """Representation of a Home Assistant image_processing state.

    See: https://www.home-assistant.io/integrations/image_processing/
    """

    domain: Literal["image_processing"]

    attributes: ImageProcessingAttributes

InputAttributesBase

Bases: AttributesBase

Base attributes class for all input states.

Source code in src/hassette/models/states/input.py
11
12
13
14
class InputAttributesBase(AttributesBase):
    """Base attributes class for all input states."""

    editable: bool | None = Field(default=None)

InputBooleanState

Bases: BoolBaseState

Representation of a Home Assistant input_boolean state.

See: https://www.home-assistant.io/integrations/input_boolean/

Source code in src/hassette/models/states/input.py
17
18
19
20
21
22
23
24
25
class InputBooleanState(BoolBaseState):
    """Representation of a Home Assistant input_boolean state.

    See: https://www.home-assistant.io/integrations/input_boolean/
    """

    domain: Literal["input_boolean"]

    attributes: InputAttributesBase

InputButtonState

Bases: DateTimeBaseState

Representation of a Home Assistant input_button state.

See: https://www.home-assistant.io/integrations/input_button/

Source code in src/hassette/models/states/input.py
28
29
30
31
32
33
34
35
36
class InputButtonState(DateTimeBaseState):
    """Representation of a Home Assistant input_button state.

    See: https://www.home-assistant.io/integrations/input_button/
    """

    domain: Literal["input_button"]

    attributes: InputAttributesBase

InputDatetimeState

Bases: DateTimeBaseState

Representation of a Home Assistant input_datetime state.

See: https://www.home-assistant.io/integrations/input_datetime/

Source code in src/hassette/models/states/input.py
63
64
65
66
67
68
69
70
71
class InputDatetimeState(DateTimeBaseState):
    """Representation of a Home Assistant input_datetime state.

    See: https://www.home-assistant.io/integrations/input_datetime/
    """

    domain: Literal["input_datetime"]

    attributes: InputDatetimeAttributes

InputNumberState

Bases: NumericBaseState

Representation of a Home Assistant input_number state.

See: https://www.home-assistant.io/integrations/input_number/

Source code in src/hassette/models/states/input.py
82
83
84
85
86
87
88
89
90
class InputNumberState(NumericBaseState):
    """Representation of a Home Assistant input_number state.

    See: https://www.home-assistant.io/integrations/input_number/
    """

    domain: Literal["input_number"]

    attributes: InputNumberAttributes

InputSelectState

Bases: StringBaseState

Representation of a Home Assistant input_select state.

See: https://www.home-assistant.io/integrations/input_select/

Source code in src/hassette/models/states/input.py
 97
 98
 99
100
101
102
103
104
105
class InputSelectState(StringBaseState):
    """Representation of a Home Assistant input_select state.

    See: https://www.home-assistant.io/integrations/input_select/
    """

    domain: Literal["input_select"]

    attributes: InputSelectAttributes

InputTextState

Bases: StringBaseState

Representation of a Home Assistant input_text state.

See: https://www.home-assistant.io/integrations/input_text/

Source code in src/hassette/models/states/input.py
115
116
117
118
119
120
121
122
123
class InputTextState(StringBaseState):
    """Representation of a Home Assistant input_text state.

    See: https://www.home-assistant.io/integrations/input_text/
    """

    domain: Literal["input_text"]

    attributes: InputTextAttributes

LawnMowerState

Bases: StringBaseState

Representation of a Home Assistant lawn_mower state.

See: https://www.home-assistant.io/integrations/lawn_mower/

Source code in src/hassette/models/states/lawn_mower.py
39
40
41
42
43
44
45
46
47
class LawnMowerState(StringBaseState):
    """Representation of a Home Assistant lawn_mower state.

    See: https://www.home-assistant.io/integrations/lawn_mower/
    """

    domain: Literal["lawn_mower"]

    attributes: LawnMowerAttributes

LightState

Bases: BoolBaseState

Representation of a Home Assistant light state.

See: https://www.home-assistant.io/integrations/light/

Source code in src/hassette/models/states/light.py
56
57
58
59
60
61
62
63
64
class LightState(BoolBaseState):
    """Representation of a Home Assistant light state.

    See: https://www.home-assistant.io/integrations/light/
    """

    domain: Literal["light"]

    attributes: LightAttributes

LockState

Bases: StringBaseState

Representation of a Home Assistant lock state.

See: https://www.home-assistant.io/integrations/lock/

Source code in src/hassette/models/states/lock.py
38
39
40
41
42
43
44
45
46
class LockState(StringBaseState):
    """Representation of a Home Assistant lock state.

    See: https://www.home-assistant.io/integrations/lock/
    """

    domain: Literal["lock"]

    attributes: LockAttributes

MediaPlayerState

Bases: StringBaseState

Representation of a Home Assistant media_player state.

See: https://www.home-assistant.io/integrations/media_player/

Source code in src/hassette/models/states/media_player.py
241
242
243
244
245
246
247
248
249
class MediaPlayerState(StringBaseState):
    """Representation of a Home Assistant media_player state.

    See: https://www.home-assistant.io/integrations/media_player/
    """

    domain: Literal["media_player"]

    attributes: MediaPlayerAttributes

NumberState

Bases: NumericBaseState

Representation of a Home Assistant number state.

See: https://www.home-assistant.io/integrations/number/

Source code in src/hassette/models/states/number.py
89
90
91
92
93
94
95
96
97
class NumberState(NumericBaseState):
    """Representation of a Home Assistant number state.

    See: https://www.home-assistant.io/integrations/number/
    """

    domain: Literal["number"]

    attributes: NumberAttributes

PersonState

Bases: StringBaseState

Representation of a Home Assistant person state.

See: https://www.home-assistant.io/integrations/person/

Source code in src/hassette/models/states/person.py
21
22
23
24
25
26
27
28
29
class PersonState(StringBaseState):
    """Representation of a Home Assistant person state.

    See: https://www.home-assistant.io/integrations/person/
    """

    domain: Literal["person"]

    attributes: PersonAttributes

RemoteState

Bases: BoolBaseState

Representation of a Home Assistant remote state.

See: https://www.home-assistant.io/integrations/remote/

Source code in src/hassette/models/states/remote.py
32
33
34
35
36
37
38
39
40
class RemoteState(BoolBaseState):
    """Representation of a Home Assistant remote state.

    See: https://www.home-assistant.io/integrations/remote/
    """

    domain: Literal["remote"]

    attributes: RemoteAttributes

SceneState

Bases: DateTimeBaseState

Representation of a Home Assistant scene state.

See: https://www.home-assistant.io/integrations/scene/

Source code in src/hassette/models/states/scene.py
 6
 7
 8
 9
10
11
12
class SceneState(DateTimeBaseState):
    """Representation of a Home Assistant scene state.

    See: https://www.home-assistant.io/integrations/scene/
    """

    domain: Literal["scene"]

ScriptState

Bases: BoolBaseState

Representation of a Home Assistant script state.

See: https://www.home-assistant.io/integrations/script/

Source code in src/hassette/models/states/script.py
24
25
26
27
28
29
30
31
32
class ScriptState(BoolBaseState):
    """Representation of a Home Assistant script state.

    See: https://www.home-assistant.io/integrations/script/
    """

    domain: Literal["script"]

    attributes: ScriptAttributes

SelectState

Bases: StringBaseState

Representation of a Home Assistant select state.

See: https://www.home-assistant.io/integrations/select/

Source code in src/hassette/models/states/select.py
13
14
15
16
17
18
19
20
21
class SelectState(StringBaseState):
    """Representation of a Home Assistant select state.

    See: https://www.home-assistant.io/integrations/select/
    """

    domain: Literal["select"]

    attributes: SelectAttributes

SensorState

Bases: StringBaseState

Representation of a Home Assistant sensor state.

See: https://www.home-assistant.io/integrations/sensor/

Source code in src/hassette/models/states/sensor.py
102
103
104
105
106
107
108
109
110
class SensorState(StringBaseState):
    """Representation of a Home Assistant sensor state.

    See: https://www.home-assistant.io/integrations/sensor/
    """

    domain: Literal["sensor"]

    attributes: SensorAttributes

AiTaskState

Bases: DateTimeBaseState

Representation of a Home Assistant ai_task state.

See: https://www.home-assistant.io/integrations/ai_task/

Source code in src/hassette/models/states/simple.py
 6
 7
 8
 9
10
11
12
class AiTaskState(DateTimeBaseState):
    """Representation of a Home Assistant ai_task state.

    See: https://www.home-assistant.io/integrations/ai_task/
    """

    domain: Literal["ai_task"]

ConversationState

Bases: DateTimeBaseState

Representation of a Home Assistant conversation state.

See: https://www.home-assistant.io/integrations/conversation/

Source code in src/hassette/models/states/simple.py
15
16
17
18
19
20
21
class ConversationState(DateTimeBaseState):
    """Representation of a Home Assistant conversation state.

    See: https://www.home-assistant.io/integrations/conversation/
    """

    domain: Literal["conversation"]

NotifyState

Bases: DateTimeBaseState

Representation of a Home Assistant notify state.

See: https://www.home-assistant.io/integrations/notify/

Source code in src/hassette/models/states/simple.py
24
25
26
27
28
29
30
class NotifyState(DateTimeBaseState):
    """Representation of a Home Assistant notify state.

    See: https://www.home-assistant.io/integrations/notify/
    """

    domain: Literal["notify"]

SttState

Bases: DateTimeBaseState

Representation of a Home Assistant stt state.

See: https://www.home-assistant.io/integrations/stt/

Source code in src/hassette/models/states/simple.py
33
34
35
36
37
38
39
class SttState(DateTimeBaseState):
    """Representation of a Home Assistant stt state.

    See: https://www.home-assistant.io/integrations/stt/
    """

    domain: Literal["stt"]

TtsState

Bases: DateTimeBaseState

Representation of a Home Assistant tts state.

See: https://www.home-assistant.io/integrations/tts/

Source code in src/hassette/models/states/simple.py
42
43
44
45
46
47
48
class TtsState(DateTimeBaseState):
    """Representation of a Home Assistant tts state.

    See: https://www.home-assistant.io/integrations/tts/
    """

    domain: Literal["tts"]

SirenState

Bases: BoolBaseState

Representation of a Home Assistant siren state.

See: https://www.home-assistant.io/integrations/siren/

Source code in src/hassette/models/states/siren.py
41
42
43
44
45
46
47
48
49
class SirenState(BoolBaseState):
    """Representation of a Home Assistant siren state.

    See: https://www.home-assistant.io/integrations/siren/
    """

    domain: Literal["siren"]

    attributes: SirenAttributes

SunState

Bases: StringBaseState

Representation of a Home Assistant sun state.

See: https://www.home-assistant.io/integrations/sun/

Source code in src/hassette/models/states/sun.py
30
31
32
33
34
35
36
37
38
class SunState(StringBaseState):
    """Representation of a Home Assistant sun state.

    See: https://www.home-assistant.io/integrations/sun/
    """

    domain: Literal["sun"]

    attributes: SunAttributes

SwitchState

Bases: BoolBaseState

Representation of a Home Assistant switch state.

See: https://www.home-assistant.io/integrations/switch/

Source code in src/hassette/models/states/switch.py
18
19
20
21
22
23
24
25
26
class SwitchState(BoolBaseState):
    """Representation of a Home Assistant switch state.

    See: https://www.home-assistant.io/integrations/switch/
    """

    domain: Literal["switch"]

    attributes: SwitchAttributes

TextState

Bases: StringBaseState

Representation of a Home Assistant text state.

See: https://www.home-assistant.io/integrations/text/

Source code in src/hassette/models/states/text.py
22
23
24
25
26
27
28
29
30
class TextState(StringBaseState):
    """Representation of a Home Assistant text state.

    See: https://www.home-assistant.io/integrations/text/
    """

    domain: Literal["text"]

    attributes: TextAttributes

TimeState

Bases: StringBaseState

Representation of a Home Assistant time state.

See: https://www.home-assistant.io/integrations/time/

Source code in src/hassette/models/states/time.py
13
14
15
16
17
18
19
20
21
class TimeState(StringBaseState):
    """Representation of a Home Assistant time state.

    See: https://www.home-assistant.io/integrations/time/
    """

    domain: Literal["time"]

    attributes: TimeAttributes

TimerState

Bases: StringBaseState

Representation of a Home Assistant timer state.

See: https://www.home-assistant.io/integrations/timer/

Source code in src/hassette/models/states/timer.py
25
26
27
28
29
30
31
32
33
class TimerState(StringBaseState):
    """Representation of a Home Assistant timer state.

    See: https://www.home-assistant.io/integrations/timer/
    """

    domain: Literal["timer"]

    attributes: TimerAttributes

TodoState

Bases: NumericBaseState

Representation of a Home Assistant todo state.

See: https://www.home-assistant.io/integrations/todo/

Source code in src/hassette/models/states/todo.py
64
65
66
67
68
69
70
71
72
class TodoState(NumericBaseState):
    """Representation of a Home Assistant todo state.

    See: https://www.home-assistant.io/integrations/todo/
    """

    domain: Literal["todo"]

    attributes: TodoAttributes

UpdateState

Bases: StringBaseState

Representation of a Home Assistant update state.

See: https://www.home-assistant.io/integrations/update/

Source code in src/hassette/models/states/update.py
54
55
56
57
58
59
60
61
62
class UpdateState(StringBaseState):
    """Representation of a Home Assistant update state.

    See: https://www.home-assistant.io/integrations/update/
    """

    domain: Literal["update"]

    attributes: UpdateAttributes

VacuumState

Bases: StringBaseState

Representation of a Home Assistant vacuum state.

See: https://www.home-assistant.io/integrations/vacuum/

Source code in src/hassette/models/states/vacuum.py
104
105
106
107
108
109
110
111
112
class VacuumState(StringBaseState):
    """Representation of a Home Assistant vacuum state.

    See: https://www.home-assistant.io/integrations/vacuum/
    """

    domain: Literal["vacuum"]

    attributes: VacuumAttributes

ValveState

Bases: StringBaseState

Representation of a Home Assistant valve state.

See: https://www.home-assistant.io/integrations/valve/

Source code in src/hassette/models/states/valve.py
13
14
15
16
17
18
19
20
21
class ValveState(StringBaseState):
    """Representation of a Home Assistant valve state.

    See: https://www.home-assistant.io/integrations/valve/
    """

    domain: Literal["valve"]

    attributes: ValveAttributes

WaterHeaterState

Bases: StringBaseState

Representation of a Home Assistant water_heater state.

See: https://www.home-assistant.io/integrations/water_heater/

Source code in src/hassette/models/states/water_heater.py
47
48
49
50
51
52
53
54
55
class WaterHeaterState(StringBaseState):
    """Representation of a Home Assistant water_heater state.

    See: https://www.home-assistant.io/integrations/water_heater/
    """

    domain: Literal["water_heater"]

    attributes: WaterHeaterAttributes

WeatherState

Bases: StringBaseState

Representation of a Home Assistant weather state.

See: https://www.home-assistant.io/integrations/weather/

Source code in src/hassette/models/states/weather.py
49
50
51
52
53
54
55
56
57
class WeatherState(StringBaseState):
    """Representation of a Home Assistant weather state.

    See: https://www.home-assistant.io/integrations/weather/
    """

    domain: Literal["weather"]

    attributes: WeatherAttributes

ZoneState

Bases: NumericBaseState

Representation of a Home Assistant zone state.

See: https://www.home-assistant.io/integrations/zone/

Source code in src/hassette/models/states/zone.py
17
18
19
20
21
22
23
24
25
class ZoneState(NumericBaseState):
    """Representation of a Home Assistant zone state.

    See: https://www.home-assistant.io/integrations/zone/
    """

    domain: Literal["zone"]

    attributes: ZoneAttributes