Struct hass_mqtt_discovery::entity::Cover
source · pub struct Cover<'a> {Show 42 fields
pub availability: Cow<'a, [Availability<'a>]>,
pub availability_mode: AvailabilityMode,
pub device: Option<Device<'a>>,
pub enabled_by_default: Option<bool>,
pub encoding: Option<Cow<'a, str>>,
pub entity_category: EntityCategory,
pub icon: Option<Icon<'a>>,
pub json_attributes_template: Option<Template<'a>>,
pub json_attributes_topic: Option<Topic<'a>>,
pub name: Option<Name<'a>>,
pub object_id: Option<Cow<'a, str>>,
pub qos: MqttQoS,
pub unique_id: Option<UniqueId<'a>>,
pub command_topic: Option<Topic<'a>>,
pub device_class: DeviceClass,
pub optimistic: Option<bool>,
pub payload_close: Option<Payload<'a>>,
pub payload_open: Option<Payload<'a>>,
pub payload_stop: Option<Payload<'a>>,
pub position_closed: Option<u32>,
pub position_open: Option<u32>,
pub position_template: Option<Template<'a>>,
pub position_topic: Option<Topic<'a>>,
pub retain: Option<bool>,
pub set_position_template: Option<Template<'a>>,
pub set_position_topic: Option<Topic<'a>>,
pub state_closed: Option<Payload<'a>>,
pub state_closing: Option<Payload<'a>>,
pub state_open: Option<Payload<'a>>,
pub state_opening: Option<Payload<'a>>,
pub state_stopped: Option<Payload<'a>>,
pub state_topic: Option<Topic<'a>>,
pub tilt_closed_value: Option<u32>,
pub tilt_command_template: Option<Template<'a>>,
pub tilt_command_topic: Option<Topic<'a>>,
pub tilt_max: Option<u32>,
pub tilt_min: Option<u32>,
pub tilt_opened_value: Option<u32>,
pub tile_optimistic: Option<bool>,
pub tilt_status_template: Option<Template<'a>>,
pub tilt_status_topic: Option<Topic<'a>>,
pub value_template: Option<Template<'a>>,
}
Expand description
The mqtt cover platform allows you to control an MQTT cover (such as blinds, a roller shutter or a garage door).
Fields§
§availability: Cow<'a, [Availability<'a>]>
A list of MQTT topics subscribed to receive availability (online/offline) updates.
availability_mode: AvailabilityMode
When availability
is configured, this controls the conditions needed
to set the entity to available
.
device: Option<Device<'a>>
Information about the device this entity is a part of to tie it into the device registry.
Only works through MQTT discovery and when unique_id
is set.
At least one of identifiers or connections must be present to identify the device.
enabled_by_default: Option<bool>
Flag which defines if the entity should be enabled when first added.
Defaults to true
.
encoding: Option<Cow<'a, str>>
The encoding of the payloads received and published messages. Set to “” to disable decoding of incoming payload.
Defaults to "utf-8"
.
entity_category: EntityCategory
The category of the entity.
icon: Option<Icon<'a>>
Icon for the entity.
json_attributes_template: Option<Template<'a>>
Defines a template to extract the JSON dictionary from messages received
on the json_attributes_topic
.
json_attributes_topic: Option<Topic<'a>>
The MQTT topic subscribed to receive a JSON dictionary payload and then set as entity attributes.
Implies force_update
of the current state when a message is received on this topic.
name: Option<Name<'a>>
The name of the MQTT entity.
object_id: Option<Cow<'a, str>>
Used instead of name
for automatic generation of entity_id
.
qos: MqttQoS
The maximum QoS level of the state topic.
unique_id: Option<UniqueId<'a>>
An ID that uniquely identifies this entity. If two entities have the same unique ID, Home Assistant will raise an exception.
command_topic: Option<Topic<'a>>
The MQTT topic to publish commands to control the cover.
device_class: DeviceClass
Sets the class of the device, changing the device state and icon that is displayed on the frontend.
optimistic: Option<bool>
Flag that defines if the cover works in optimistic mode.
Defaults to false
if a state_topic
or position_topic
is defined, else true
.
payload_close: Option<Payload<'a>>
The command payload that closes the cover.
Defaults to "CLOSE"
.
payload_open: Option<Payload<'a>>
The command payload that opens the cover.
Defaults to "OPEN"
.
payload_stop: Option<Payload<'a>>
The command payload that stops the cover.
Defaults to "STOP"
.
position_closed: Option<u32>
Number which represents closed position.
Defaults to 0
.
position_open: Option<u32>
Number which represents open position.
Defaults to 100
.
position_template: Option<Template<'a>>
Defines a template that can be used to extract the
payload for the position_topic
topic. Within the template the
following variables are available:
entity_id
position_open
position_closed
tilt_min
tilt_max
The entity_id
can be used to reference the entity’s attributes with
the help of the states template function.
position_topic: Option<Topic<'a>>
The MQTT topic subscribed to receive cover position messages.
retain: Option<bool>
Defines if published messages should have the retain flag set.
Defaults to false
.
set_position_template: Option<Template<'a>>
Defines a template to define the position to be sent
to the set_position_topic
topic. Incoming position value is
available for use in the template {{ position }}
. Within the
template the following variables are available:
entity_id
position
in percentposition_open
position_closed
tilt_min
tilt_max
The entity_id
can be used to reference the entity’s attributes with
the help of the states template function.
set_position_topic: Option<Topic<'a>>
The MQTT topic to publish position commands to.
You need to set position_topic
as well if you want to use position
topic. Use template if position topic wants different values than within
range position_closed
- position_open
. If template is not defined
and position_closed
!= 100 and position_open
!= 0 then proper
position value is calculated from percentage position.
state_closed: Option<Payload<'a>>
The payload that represents the closed state.
Defaults to "closed"
.
state_closing: Option<Payload<'a>>
The payload that represents the closing state.
Defaults to "closing"
.
state_open: Option<Payload<'a>>
The payload that represents the open state.
Defaults to "open"
.
state_opening: Option<Payload<'a>>
The payload that represents the opening state.
Defaults to "opening"
.
state_stopped: Option<Payload<'a>>
The payload that represents the stopped state
(for covers that do not report open
/closed
state).
Defaults to "stopped"
.
state_topic: Option<Topic<'a>>
The MQTT topic subscribed to receive cover state messages.
State topic can only read (open
, opening
, closed
, closing
or stopped
) state.
tilt_closed_value: Option<u32>
The value that will be sent on a close_cover_tilt command.
Defaults to 0
.
tilt_command_template: Option<Template<'a>>
Defines a template that can be used to extract the
payload for the tilt_command_topic
topic. Within the template
the following variables are available:
entity_id
tilt_position
in percentposition_open
position_closed
tilt_min
tilt_max
The entity_id
can be used to reference the entity’s attributes
with the help of the states template function.
tilt_command_topic: Option<Topic<'a>>
The MQTT topic to publish commands to control the cover tilt.
tilt_max: Option<u32>
The maximum tilt value.
Defaults to 100
.
tilt_min: Option<u32>
The minimum tilt value.
Defaults to 0
.
tilt_opened_value: Option<u32>
The value that will be sent on an open_cover_tilt
command.
Defaults to 100
.
tile_optimistic: Option<bool>
Flag that determines if tilt works in optimistic mode.
Defaults to true
if tilt_status_topic
is not defined, else false
.
tilt_status_template: Option<Template<'a>>
Defines a template that can be used to extract the
payload for the tilt_status_topic
topic. Within the template
the following variables are available:
entity_id
position_open
position_closed
tilt_min
tilt_max
The entity_id
can be used to reference the entity’s attributes
with the help of the states template function.
tilt_status_topic: Option<Topic<'a>>
The MQTT topic subscribed to receive tilt status update values.
value_template: Option<Template<'a>>
Defines a template that can be used to extract the
payload for the state_topic
topic.
Implementations§
source§impl<'a> Cover<'a>
impl<'a> Cover<'a>
pub fn new() -> Self
sourcepub fn availability(
self,
availability: impl Into<Cow<'a, [Availability<'a>]>>
) -> Self
pub fn availability(
self,
availability: impl Into<Cow<'a, [Availability<'a>]>>
) -> Self
A list of MQTT topics subscribed to receive availability (online/offline) updates.
sourcepub fn availability_mode(
self,
availability_mode: impl Into<AvailabilityMode>
) -> Self
pub fn availability_mode(
self,
availability_mode: impl Into<AvailabilityMode>
) -> Self
When availability
is configured, this controls the conditions needed
to set the entity to available
.
sourcepub fn device(self, device: impl Into<Device<'a>>) -> Self
pub fn device(self, device: impl Into<Device<'a>>) -> Self
Information about the device this entity is a part of to tie it into the device registry.
Only works through MQTT discovery and when unique_id
is set.
At least one of identifiers or connections must be present to identify the device.
sourcepub fn unset_device(&mut self) -> &mut Self
pub fn unset_device(&mut self) -> &mut Self
Information about the device this entity is a part of to tie it into the device registry.
Only works through MQTT discovery and when unique_id
is set.
At least one of identifiers or connections must be present to identify the device.
sourcepub fn enabled_by_default(self, enabled_by_default: impl Into<bool>) -> Self
pub fn enabled_by_default(self, enabled_by_default: impl Into<bool>) -> Self
Flag which defines if the entity should be enabled when first added.
Defaults to true
.
sourcepub fn unset_enabled_by_default(&mut self) -> &mut Self
pub fn unset_enabled_by_default(&mut self) -> &mut Self
Flag which defines if the entity should be enabled when first added.
Defaults to true
.
sourcepub fn encoding(self, encoding: impl Into<Cow<'a, str>>) -> Self
pub fn encoding(self, encoding: impl Into<Cow<'a, str>>) -> Self
The encoding of the payloads received and published messages. Set to “” to disable decoding of incoming payload.
Defaults to "utf-8"
.
sourcepub fn unset_encoding(&mut self) -> &mut Self
pub fn unset_encoding(&mut self) -> &mut Self
The encoding of the payloads received and published messages. Set to “” to disable decoding of incoming payload.
Defaults to "utf-8"
.
sourcepub fn entity_category(self, entity_category: impl Into<EntityCategory>) -> Self
pub fn entity_category(self, entity_category: impl Into<EntityCategory>) -> Self
The category of the entity.
sourcepub fn unset_icon(&mut self) -> &mut Self
pub fn unset_icon(&mut self) -> &mut Self
Icon for the entity.
sourcepub fn json_attributes_template(
self,
json_attributes_template: impl Into<Template<'a>>
) -> Self
pub fn json_attributes_template(
self,
json_attributes_template: impl Into<Template<'a>>
) -> Self
Defines a template to extract the JSON dictionary from messages received
on the json_attributes_topic
.
sourcepub fn unset_json_attributes_template(&mut self) -> &mut Self
pub fn unset_json_attributes_template(&mut self) -> &mut Self
Defines a template to extract the JSON dictionary from messages received
on the json_attributes_topic
.
sourcepub fn json_attributes_topic(
self,
json_attributes_topic: impl Into<Topic<'a>>
) -> Self
pub fn json_attributes_topic(
self,
json_attributes_topic: impl Into<Topic<'a>>
) -> Self
The MQTT topic subscribed to receive a JSON dictionary payload and then set as entity attributes.
Implies force_update
of the current state when a message is received on this topic.
sourcepub fn unset_json_attributes_topic(&mut self) -> &mut Self
pub fn unset_json_attributes_topic(&mut self) -> &mut Self
The MQTT topic subscribed to receive a JSON dictionary payload and then set as entity attributes.
Implies force_update
of the current state when a message is received on this topic.
sourcepub fn unset_name(&mut self) -> &mut Self
pub fn unset_name(&mut self) -> &mut Self
The name of the MQTT entity.
sourcepub fn object_id(self, object_id: impl Into<Cow<'a, str>>) -> Self
pub fn object_id(self, object_id: impl Into<Cow<'a, str>>) -> Self
Used instead of name
for automatic generation of entity_id
.
sourcepub fn unset_object_id(&mut self) -> &mut Self
pub fn unset_object_id(&mut self) -> &mut Self
Used instead of name
for automatic generation of entity_id
.
sourcepub fn unique_id(self, unique_id: impl Into<UniqueId<'a>>) -> Self
pub fn unique_id(self, unique_id: impl Into<UniqueId<'a>>) -> Self
An ID that uniquely identifies this entity. If two entities have the same unique ID, Home Assistant will raise an exception.
sourcepub fn unset_unique_id(&mut self) -> &mut Self
pub fn unset_unique_id(&mut self) -> &mut Self
An ID that uniquely identifies this entity. If two entities have the same unique ID, Home Assistant will raise an exception.
sourcepub fn command_topic(self, command_topic: impl Into<Topic<'a>>) -> Self
pub fn command_topic(self, command_topic: impl Into<Topic<'a>>) -> Self
The MQTT topic to publish commands to control the cover.
sourcepub fn unset_command_topic(&mut self) -> &mut Self
pub fn unset_command_topic(&mut self) -> &mut Self
The MQTT topic to publish commands to control the cover.
sourcepub fn device_class(self, device_class: impl Into<DeviceClass>) -> Self
pub fn device_class(self, device_class: impl Into<DeviceClass>) -> Self
Sets the class of the device, changing the device state and icon that is displayed on the frontend.
sourcepub fn optimistic(self, optimistic: impl Into<bool>) -> Self
pub fn optimistic(self, optimistic: impl Into<bool>) -> Self
Flag that defines if the cover works in optimistic mode.
Defaults to false
if a state_topic
or position_topic
is defined, else true
.
sourcepub fn unset_optimistic(&mut self) -> &mut Self
pub fn unset_optimistic(&mut self) -> &mut Self
Flag that defines if the cover works in optimistic mode.
Defaults to false
if a state_topic
or position_topic
is defined, else true
.
sourcepub fn payload_close(self, payload_close: impl Into<Payload<'a>>) -> Self
pub fn payload_close(self, payload_close: impl Into<Payload<'a>>) -> Self
The command payload that closes the cover.
Defaults to "CLOSE"
.
sourcepub fn unset_payload_close(&mut self) -> &mut Self
pub fn unset_payload_close(&mut self) -> &mut Self
The command payload that closes the cover.
Defaults to "CLOSE"
.
sourcepub fn payload_open(self, payload_open: impl Into<Payload<'a>>) -> Self
pub fn payload_open(self, payload_open: impl Into<Payload<'a>>) -> Self
The command payload that opens the cover.
Defaults to "OPEN"
.
sourcepub fn unset_payload_open(&mut self) -> &mut Self
pub fn unset_payload_open(&mut self) -> &mut Self
The command payload that opens the cover.
Defaults to "OPEN"
.
sourcepub fn payload_stop(self, payload_stop: impl Into<Payload<'a>>) -> Self
pub fn payload_stop(self, payload_stop: impl Into<Payload<'a>>) -> Self
The command payload that stops the cover.
Defaults to "STOP"
.
sourcepub fn unset_payload_stop(&mut self) -> &mut Self
pub fn unset_payload_stop(&mut self) -> &mut Self
The command payload that stops the cover.
Defaults to "STOP"
.
sourcepub fn position_closed(self, position_closed: impl Into<u32>) -> Self
pub fn position_closed(self, position_closed: impl Into<u32>) -> Self
Number which represents closed position.
Defaults to 0
.
sourcepub fn unset_position_closed(&mut self) -> &mut Self
pub fn unset_position_closed(&mut self) -> &mut Self
Number which represents closed position.
Defaults to 0
.
sourcepub fn position_open(self, position_open: impl Into<u32>) -> Self
pub fn position_open(self, position_open: impl Into<u32>) -> Self
Number which represents open position.
Defaults to 100
.
sourcepub fn unset_position_open(&mut self) -> &mut Self
pub fn unset_position_open(&mut self) -> &mut Self
Number which represents open position.
Defaults to 100
.
sourcepub fn position_template(
self,
position_template: impl Into<Template<'a>>
) -> Self
pub fn position_template(
self,
position_template: impl Into<Template<'a>>
) -> Self
Defines a template that can be used to extract the
payload for the position_topic
topic. Within the template the
following variables are available:
entity_id
position_open
position_closed
tilt_min
tilt_max
The entity_id
can be used to reference the entity’s attributes with
the help of the states template function.
sourcepub fn unset_position_template(&mut self) -> &mut Self
pub fn unset_position_template(&mut self) -> &mut Self
Defines a template that can be used to extract the
payload for the position_topic
topic. Within the template the
following variables are available:
entity_id
position_open
position_closed
tilt_min
tilt_max
The entity_id
can be used to reference the entity’s attributes with
the help of the states template function.
sourcepub fn position_topic(self, position_topic: impl Into<Topic<'a>>) -> Self
pub fn position_topic(self, position_topic: impl Into<Topic<'a>>) -> Self
The MQTT topic subscribed to receive cover position messages.
sourcepub fn unset_position_topic(&mut self) -> &mut Self
pub fn unset_position_topic(&mut self) -> &mut Self
The MQTT topic subscribed to receive cover position messages.
sourcepub fn retain(self, retain: impl Into<bool>) -> Self
pub fn retain(self, retain: impl Into<bool>) -> Self
Defines if published messages should have the retain flag set.
Defaults to false
.
sourcepub fn unset_retain(&mut self) -> &mut Self
pub fn unset_retain(&mut self) -> &mut Self
Defines if published messages should have the retain flag set.
Defaults to false
.
sourcepub fn set_position_template(
self,
set_position_template: impl Into<Template<'a>>
) -> Self
pub fn set_position_template(
self,
set_position_template: impl Into<Template<'a>>
) -> Self
Defines a template to define the position to be sent
to the set_position_topic
topic. Incoming position value is
available for use in the template {{ position }}
. Within the
template the following variables are available:
entity_id
position
in percentposition_open
position_closed
tilt_min
tilt_max
The entity_id
can be used to reference the entity’s attributes with
the help of the states template function.
sourcepub fn unset_set_position_template(&mut self) -> &mut Self
pub fn unset_set_position_template(&mut self) -> &mut Self
Defines a template to define the position to be sent
to the set_position_topic
topic. Incoming position value is
available for use in the template {{ position }}
. Within the
template the following variables are available:
entity_id
position
in percentposition_open
position_closed
tilt_min
tilt_max
The entity_id
can be used to reference the entity’s attributes with
the help of the states template function.
sourcepub fn set_position_topic(self, set_position_topic: impl Into<Topic<'a>>) -> Self
pub fn set_position_topic(self, set_position_topic: impl Into<Topic<'a>>) -> Self
The MQTT topic to publish position commands to.
You need to set position_topic
as well if you want to use position
topic. Use template if position topic wants different values than within
range position_closed
- position_open
. If template is not defined
and position_closed
!= 100 and position_open
!= 0 then proper
position value is calculated from percentage position.
sourcepub fn unset_set_position_topic(&mut self) -> &mut Self
pub fn unset_set_position_topic(&mut self) -> &mut Self
The MQTT topic to publish position commands to.
You need to set position_topic
as well if you want to use position
topic. Use template if position topic wants different values than within
range position_closed
- position_open
. If template is not defined
and position_closed
!= 100 and position_open
!= 0 then proper
position value is calculated from percentage position.
sourcepub fn state_closed(self, state_closed: impl Into<Payload<'a>>) -> Self
pub fn state_closed(self, state_closed: impl Into<Payload<'a>>) -> Self
The payload that represents the closed state.
Defaults to "closed"
.
sourcepub fn unset_state_closed(&mut self) -> &mut Self
pub fn unset_state_closed(&mut self) -> &mut Self
The payload that represents the closed state.
Defaults to "closed"
.
sourcepub fn state_closing(self, state_closing: impl Into<Payload<'a>>) -> Self
pub fn state_closing(self, state_closing: impl Into<Payload<'a>>) -> Self
The payload that represents the closing state.
Defaults to "closing"
.
sourcepub fn unset_state_closing(&mut self) -> &mut Self
pub fn unset_state_closing(&mut self) -> &mut Self
The payload that represents the closing state.
Defaults to "closing"
.
sourcepub fn state_open(self, state_open: impl Into<Payload<'a>>) -> Self
pub fn state_open(self, state_open: impl Into<Payload<'a>>) -> Self
The payload that represents the open state.
Defaults to "open"
.
sourcepub fn unset_state_open(&mut self) -> &mut Self
pub fn unset_state_open(&mut self) -> &mut Self
The payload that represents the open state.
Defaults to "open"
.
sourcepub fn state_opening(self, state_opening: impl Into<Payload<'a>>) -> Self
pub fn state_opening(self, state_opening: impl Into<Payload<'a>>) -> Self
The payload that represents the opening state.
Defaults to "opening"
.
sourcepub fn unset_state_opening(&mut self) -> &mut Self
pub fn unset_state_opening(&mut self) -> &mut Self
The payload that represents the opening state.
Defaults to "opening"
.
sourcepub fn state_stopped(self, state_stopped: impl Into<Payload<'a>>) -> Self
pub fn state_stopped(self, state_stopped: impl Into<Payload<'a>>) -> Self
The payload that represents the stopped state
(for covers that do not report open
/closed
state).
Defaults to "stopped"
.
sourcepub fn unset_state_stopped(&mut self) -> &mut Self
pub fn unset_state_stopped(&mut self) -> &mut Self
The payload that represents the stopped state
(for covers that do not report open
/closed
state).
Defaults to "stopped"
.
sourcepub fn state_topic(self, state_topic: impl Into<Topic<'a>>) -> Self
pub fn state_topic(self, state_topic: impl Into<Topic<'a>>) -> Self
The MQTT topic subscribed to receive cover state messages.
State topic can only read (open
, opening
, closed
, closing
or stopped
) state.
sourcepub fn unset_state_topic(&mut self) -> &mut Self
pub fn unset_state_topic(&mut self) -> &mut Self
The MQTT topic subscribed to receive cover state messages.
State topic can only read (open
, opening
, closed
, closing
or stopped
) state.
sourcepub fn tilt_closed_value(self, tilt_closed_value: impl Into<u32>) -> Self
pub fn tilt_closed_value(self, tilt_closed_value: impl Into<u32>) -> Self
The value that will be sent on a close_cover_tilt command.
Defaults to 0
.
sourcepub fn unset_tilt_closed_value(&mut self) -> &mut Self
pub fn unset_tilt_closed_value(&mut self) -> &mut Self
The value that will be sent on a close_cover_tilt command.
Defaults to 0
.
sourcepub fn tilt_command_template(
self,
tilt_command_template: impl Into<Template<'a>>
) -> Self
pub fn tilt_command_template(
self,
tilt_command_template: impl Into<Template<'a>>
) -> Self
Defines a template that can be used to extract the
payload for the tilt_command_topic
topic. Within the template
the following variables are available:
entity_id
tilt_position
in percentposition_open
position_closed
tilt_min
tilt_max
The entity_id
can be used to reference the entity’s attributes
with the help of the states template function.
sourcepub fn unset_tilt_command_template(&mut self) -> &mut Self
pub fn unset_tilt_command_template(&mut self) -> &mut Self
Defines a template that can be used to extract the
payload for the tilt_command_topic
topic. Within the template
the following variables are available:
entity_id
tilt_position
in percentposition_open
position_closed
tilt_min
tilt_max
The entity_id
can be used to reference the entity’s attributes
with the help of the states template function.
sourcepub fn tilt_command_topic(self, tilt_command_topic: impl Into<Topic<'a>>) -> Self
pub fn tilt_command_topic(self, tilt_command_topic: impl Into<Topic<'a>>) -> Self
The MQTT topic to publish commands to control the cover tilt.
sourcepub fn unset_tilt_command_topic(&mut self) -> &mut Self
pub fn unset_tilt_command_topic(&mut self) -> &mut Self
The MQTT topic to publish commands to control the cover tilt.
sourcepub fn tilt_max(self, tilt_max: impl Into<u32>) -> Self
pub fn tilt_max(self, tilt_max: impl Into<u32>) -> Self
The maximum tilt value.
Defaults to 100
.
sourcepub fn unset_tilt_max(&mut self) -> &mut Self
pub fn unset_tilt_max(&mut self) -> &mut Self
The maximum tilt value.
Defaults to 100
.
sourcepub fn unset_tilt_min(&mut self) -> &mut Self
pub fn unset_tilt_min(&mut self) -> &mut Self
The minimum tilt value.
Defaults to 0
.
sourcepub fn tilt_opened_value(self, tilt_opened_value: impl Into<u32>) -> Self
pub fn tilt_opened_value(self, tilt_opened_value: impl Into<u32>) -> Self
The value that will be sent on an open_cover_tilt
command.
Defaults to 100
.
sourcepub fn unset_tilt_opened_value(&mut self) -> &mut Self
pub fn unset_tilt_opened_value(&mut self) -> &mut Self
The value that will be sent on an open_cover_tilt
command.
Defaults to 100
.
sourcepub fn tile_optimistic(self, tile_optimistic: impl Into<bool>) -> Self
pub fn tile_optimistic(self, tile_optimistic: impl Into<bool>) -> Self
Flag that determines if tilt works in optimistic mode.
Defaults to true
if tilt_status_topic
is not defined, else false
.
sourcepub fn unset_tile_optimistic(&mut self) -> &mut Self
pub fn unset_tile_optimistic(&mut self) -> &mut Self
Flag that determines if tilt works in optimistic mode.
Defaults to true
if tilt_status_topic
is not defined, else false
.
sourcepub fn tilt_status_template(
self,
tilt_status_template: impl Into<Template<'a>>
) -> Self
pub fn tilt_status_template(
self,
tilt_status_template: impl Into<Template<'a>>
) -> Self
Defines a template that can be used to extract the
payload for the tilt_status_topic
topic. Within the template
the following variables are available:
entity_id
position_open
position_closed
tilt_min
tilt_max
The entity_id
can be used to reference the entity’s attributes
with the help of the states template function.
sourcepub fn unset_tilt_status_template(&mut self) -> &mut Self
pub fn unset_tilt_status_template(&mut self) -> &mut Self
Defines a template that can be used to extract the
payload for the tilt_status_topic
topic. Within the template
the following variables are available:
entity_id
position_open
position_closed
tilt_min
tilt_max
The entity_id
can be used to reference the entity’s attributes
with the help of the states template function.
sourcepub fn tilt_status_topic(self, tilt_status_topic: impl Into<Topic<'a>>) -> Self
pub fn tilt_status_topic(self, tilt_status_topic: impl Into<Topic<'a>>) -> Self
The MQTT topic subscribed to receive tilt status update values.
sourcepub fn unset_tilt_status_topic(&mut self) -> &mut Self
pub fn unset_tilt_status_topic(&mut self) -> &mut Self
The MQTT topic subscribed to receive tilt status update values.
sourcepub fn value_template(self, value_template: impl Into<Template<'a>>) -> Self
pub fn value_template(self, value_template: impl Into<Template<'a>>) -> Self
Defines a template that can be used to extract the
payload for the state_topic
topic.
sourcepub fn unset_value_template(&mut self) -> &mut Self
pub fn unset_value_template(&mut self) -> &mut Self
Defines a template that can be used to extract the
payload for the state_topic
topic.
Trait Implementations§
source§impl<'de: 'a, 'a> Deserialize<'de> for Cover<'a>
impl<'de: 'a, 'a> Deserialize<'de> for Cover<'a>
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl<'a> Validate for Cover<'a>
impl<'a> Validate for Cover<'a>
§type Invalidity = CoverInvalidity
type Invalidity = CoverInvalidity
source§fn validate(&self) -> ValidationResult<Self::Invalidity>
fn validate(&self) -> ValidationResult<Self::Invalidity>
impl<'a> Eq for Cover<'a>
impl<'a> StructuralEq for Cover<'a>
impl<'a> StructuralPartialEq for Cover<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Cover<'a>
impl<'a> Send for Cover<'a>
impl<'a> Sync for Cover<'a>
impl<'a> Unpin for Cover<'a>
impl<'a> UnwindSafe for Cover<'a>
Blanket Implementations§
source§impl<T, V> IntoValidated<V> for Twhere
V: ValidatedFrom<T>,
impl<T, V> IntoValidated<V> for Twhere
V: ValidatedFrom<T>,
source§fn into_validated(
self
) -> Result<Validated<V>, (V, Context<<V as Validate>::Invalidity>)>
fn into_validated(
self
) -> Result<Validated<V>, (V, Context<<V as Validate>::Invalidity>)>
self
into output value and validate the output Read more§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
§fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
§fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
§fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
§fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
§fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
§fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
§fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
§fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
§fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
§fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
§fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
§fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
§fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
§fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
§fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
§fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
§fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
§fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
§fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg
or
a color-specific method, such as OwoColorize::green
, Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg
or
a color-specific method, such as OwoColorize::on_yellow
, Read more