Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.mqtt.vacuum Namespace Reference

Classes

class  MqttStateVacuum
 

Functions

None async_setup_entry (HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)
 
list[str] services_to_strings (VacuumEntityFeature services, dict[VacuumEntityFeature, str] service_to_string)
 

Variables

dictionary _FEATURE_PAYLOADS
 
 _LOGGER = logging.getLogger(__name__)
 
tuple ALL_SERVICES
 
string BATTERY = "battery_level"
 
string CONF_FAN_SPEED_LIST = "fan_speed_list"
 
string CONF_PAYLOAD_CLEAN_SPOT = "payload_clean_spot"
 
string CONF_PAYLOAD_LOCATE = "payload_locate"
 
string CONF_PAYLOAD_PAUSE = "payload_pause"
 
string CONF_PAYLOAD_RETURN_TO_BASE = "payload_return_to_base"
 
string CONF_PAYLOAD_START = "payload_start"
 
string CONF_PAYLOAD_STOP = "payload_stop"
 
string CONF_PAYLOAD_TURN_OFF = "payload_turn_off"
 
string CONF_PAYLOAD_TURN_ON = "payload_turn_on"
 
string CONF_SEND_COMMAND_TOPIC = "send_command_topic"
 
string CONF_SET_FAN_SPEED_TOPIC = "set_fan_speed_topic"
 
 CONF_SUPPORTED_FEATURES = ATTR_SUPPORTED_FEATURES
 
string DEFAULT_NAME = "MQTT State Vacuum"
 
string DEFAULT_PAYLOAD_CLEAN_SPOT = "clean_spot"
 
string DEFAULT_PAYLOAD_LOCATE = "locate"
 
string DEFAULT_PAYLOAD_PAUSE = "pause"
 
string DEFAULT_PAYLOAD_RETURN_TO_BASE = "return_to_base"
 
string DEFAULT_PAYLOAD_START = "start"
 
string DEFAULT_PAYLOAD_STOP = "stop"
 
bool DEFAULT_RETAIN = False
 
list[str] DEFAULT_SERVICE_STRINGS = services_to_strings(DEFAULT_SERVICES, SERVICE_TO_STRING)
 
tuple DEFAULT_SERVICES
 
 DISCOVERY_SCHEMA = PLATFORM_SCHEMA_MODERN.extend({}, extra=vol.ALLOW_EXTRA)
 
string FAN_SPEED = "fan_speed"
 
 MQTT_VACUUM_ATTRIBUTES_BLOCKED
 
string MQTT_VACUUM_DOCS_URL = "https://www.home-assistant.io/integrations/vacuum.mqtt/"
 
int PARALLEL_UPDATES = 0
 
 PLATFORM_SCHEMA_MODERN
 
string STATE = "state"
 
dictionary STRING_TO_SERVICE = {v: k for k, v in SERVICE_TO_STRING.items()}
 

Detailed Description

Support for MQTT vacuums.

Function Documentation

◆ async_setup_entry()

None homeassistant.components.mqtt.vacuum.async_setup_entry ( HomeAssistant  hass,
ConfigEntry  config_entry,
AddEntitiesCallback  async_add_entities 
)
Set up MQTT vacuum through YAML and through MQTT discovery.

Definition at line 176 of file vacuum.py.

◆ services_to_strings()

list[str] homeassistant.components.mqtt.vacuum.services_to_strings ( VacuumEntityFeature  services,
dict[VacuumEntityFeature, str]  service_to_string 
)
Convert SUPPORT_* service bitmask to list of service strings.

Definition at line 112 of file vacuum.py.

Variable Documentation

◆ _FEATURE_PAYLOADS

dictionary homeassistant.components.mqtt.vacuum._FEATURE_PAYLOADS
private
Initial value:
1 = {
2  VacuumEntityFeature.START: CONF_PAYLOAD_START,
3  VacuumEntityFeature.STOP: CONF_PAYLOAD_STOP,
4  VacuumEntityFeature.PAUSE: CONF_PAYLOAD_PAUSE,
5  VacuumEntityFeature.CLEAN_SPOT: CONF_PAYLOAD_CLEAN_SPOT,
6  VacuumEntityFeature.LOCATE: CONF_PAYLOAD_LOCATE,
7  VacuumEntityFeature.RETURN_HOME: CONF_PAYLOAD_RETURN_TO_BASE,
8 }

Definition at line 126 of file vacuum.py.

◆ _LOGGER

homeassistant.components.mqtt.vacuum._LOGGER = logging.getLogger(__name__)
private

Definition at line 80 of file vacuum.py.

◆ ALL_SERVICES

tuple homeassistant.components.mqtt.vacuum.ALL_SERVICES
Initial value:
1 = (
2  DEFAULT_SERVICES
3  | VacuumEntityFeature.PAUSE
4  | VacuumEntityFeature.LOCATE
5  | VacuumEntityFeature.FAN_SPEED
6  | VacuumEntityFeature.SEND_COMMAND
7 )

Definition at line 103 of file vacuum.py.

◆ BATTERY

string homeassistant.components.mqtt.vacuum.BATTERY = "battery_level"

Definition at line 44 of file vacuum.py.

◆ CONF_FAN_SPEED_LIST

string homeassistant.components.mqtt.vacuum.CONF_FAN_SPEED_LIST = "fan_speed_list"

Definition at line 67 of file vacuum.py.

◆ CONF_PAYLOAD_CLEAN_SPOT

string homeassistant.components.mqtt.vacuum.CONF_PAYLOAD_CLEAN_SPOT = "payload_clean_spot"

Definition at line 62 of file vacuum.py.

◆ CONF_PAYLOAD_LOCATE

string homeassistant.components.mqtt.vacuum.CONF_PAYLOAD_LOCATE = "payload_locate"

Definition at line 63 of file vacuum.py.

◆ CONF_PAYLOAD_PAUSE

string homeassistant.components.mqtt.vacuum.CONF_PAYLOAD_PAUSE = "payload_pause"

Definition at line 65 of file vacuum.py.

◆ CONF_PAYLOAD_RETURN_TO_BASE

string homeassistant.components.mqtt.vacuum.CONF_PAYLOAD_RETURN_TO_BASE = "payload_return_to_base"

Definition at line 60 of file vacuum.py.

◆ CONF_PAYLOAD_START

string homeassistant.components.mqtt.vacuum.CONF_PAYLOAD_START = "payload_start"

Definition at line 64 of file vacuum.py.

◆ CONF_PAYLOAD_STOP

string homeassistant.components.mqtt.vacuum.CONF_PAYLOAD_STOP = "payload_stop"

Definition at line 61 of file vacuum.py.

◆ CONF_PAYLOAD_TURN_OFF

string homeassistant.components.mqtt.vacuum.CONF_PAYLOAD_TURN_OFF = "payload_turn_off"

Definition at line 59 of file vacuum.py.

◆ CONF_PAYLOAD_TURN_ON

string homeassistant.components.mqtt.vacuum.CONF_PAYLOAD_TURN_ON = "payload_turn_on"

Definition at line 58 of file vacuum.py.

◆ CONF_SEND_COMMAND_TOPIC

string homeassistant.components.mqtt.vacuum.CONF_SEND_COMMAND_TOPIC = "send_command_topic"

Definition at line 68 of file vacuum.py.

◆ CONF_SET_FAN_SPEED_TOPIC

string homeassistant.components.mqtt.vacuum.CONF_SET_FAN_SPEED_TOPIC = "set_fan_speed_topic"

Definition at line 66 of file vacuum.py.

◆ CONF_SUPPORTED_FEATURES

homeassistant.components.mqtt.vacuum.CONF_SUPPORTED_FEATURES = ATTR_SUPPORTED_FEATURES

Definition at line 57 of file vacuum.py.

◆ DEFAULT_NAME

string homeassistant.components.mqtt.vacuum.DEFAULT_NAME = "MQTT State Vacuum"

Definition at line 70 of file vacuum.py.

◆ DEFAULT_PAYLOAD_CLEAN_SPOT

string homeassistant.components.mqtt.vacuum.DEFAULT_PAYLOAD_CLEAN_SPOT = "clean_spot"

Definition at line 75 of file vacuum.py.

◆ DEFAULT_PAYLOAD_LOCATE

string homeassistant.components.mqtt.vacuum.DEFAULT_PAYLOAD_LOCATE = "locate"

Definition at line 76 of file vacuum.py.

◆ DEFAULT_PAYLOAD_PAUSE

string homeassistant.components.mqtt.vacuum.DEFAULT_PAYLOAD_PAUSE = "pause"

Definition at line 78 of file vacuum.py.

◆ DEFAULT_PAYLOAD_RETURN_TO_BASE

string homeassistant.components.mqtt.vacuum.DEFAULT_PAYLOAD_RETURN_TO_BASE = "return_to_base"

Definition at line 73 of file vacuum.py.

◆ DEFAULT_PAYLOAD_START

string homeassistant.components.mqtt.vacuum.DEFAULT_PAYLOAD_START = "start"

Definition at line 77 of file vacuum.py.

◆ DEFAULT_PAYLOAD_STOP

string homeassistant.components.mqtt.vacuum.DEFAULT_PAYLOAD_STOP = "stop"

Definition at line 74 of file vacuum.py.

◆ DEFAULT_RETAIN

bool homeassistant.components.mqtt.vacuum.DEFAULT_RETAIN = False

Definition at line 71 of file vacuum.py.

◆ DEFAULT_SERVICE_STRINGS

list[str] homeassistant.components.mqtt.vacuum.DEFAULT_SERVICE_STRINGS = services_to_strings(DEFAULT_SERVICES, SERVICE_TO_STRING)

Definition at line 124 of file vacuum.py.

◆ DEFAULT_SERVICES

tuple homeassistant.components.mqtt.vacuum.DEFAULT_SERVICES
Initial value:
1 = (
2  VacuumEntityFeature.START
3  | VacuumEntityFeature.STOP
4  | VacuumEntityFeature.RETURN_HOME
5  | VacuumEntityFeature.BATTERY
6  | VacuumEntityFeature.CLEAN_SPOT
7 )

Definition at line 96 of file vacuum.py.

◆ DISCOVERY_SCHEMA

homeassistant.components.mqtt.vacuum.DISCOVERY_SCHEMA = PLATFORM_SCHEMA_MODERN.extend({}, extra=vol.ALLOW_EXTRA)

Definition at line 173 of file vacuum.py.

◆ FAN_SPEED

string homeassistant.components.mqtt.vacuum.FAN_SPEED = "fan_speed"

Definition at line 45 of file vacuum.py.

◆ MQTT_VACUUM_ATTRIBUTES_BLOCKED

homeassistant.components.mqtt.vacuum.MQTT_VACUUM_ATTRIBUTES_BLOCKED
Initial value:
1 = frozenset(
2  {
3  vacuum.ATTR_BATTERY_ICON,
4  vacuum.ATTR_BATTERY_LEVEL,
5  vacuum.ATTR_FAN_SPEED,
6  }
7 )

Definition at line 135 of file vacuum.py.

◆ MQTT_VACUUM_DOCS_URL

string homeassistant.components.mqtt.vacuum.MQTT_VACUUM_DOCS_URL = "https://www.home-assistant.io/integrations/vacuum.mqtt/"

Definition at line 143 of file vacuum.py.

◆ PARALLEL_UPDATES

int homeassistant.components.mqtt.vacuum.PARALLEL_UPDATES = 0

Definition at line 42 of file vacuum.py.

◆ PLATFORM_SCHEMA_MODERN

homeassistant.components.mqtt.vacuum.PLATFORM_SCHEMA_MODERN
Initial value:
1 = MQTT_BASE_SCHEMA.extend(
2  {
3  vol.Optional(CONF_FAN_SPEED_LIST, default=[]): vol.All(
4  cv.ensure_list, [cv.string]
5  ),
6  vol.Optional(CONF_NAME): vol.Any(cv.string, None),
7  vol.Optional(
8  CONF_PAYLOAD_CLEAN_SPOT, default=DEFAULT_PAYLOAD_CLEAN_SPOT
9  ): cv.string,
10  vol.Optional(CONF_PAYLOAD_LOCATE, default=DEFAULT_PAYLOAD_LOCATE): cv.string,
11  vol.Optional(
12  CONF_PAYLOAD_RETURN_TO_BASE, default=DEFAULT_PAYLOAD_RETURN_TO_BASE
13  ): cv.string,
14  vol.Optional(CONF_PAYLOAD_START, default=DEFAULT_PAYLOAD_START): cv.string,
15  vol.Optional(CONF_PAYLOAD_PAUSE, default=DEFAULT_PAYLOAD_PAUSE): cv.string,
16  vol.Optional(CONF_PAYLOAD_STOP, default=DEFAULT_PAYLOAD_STOP): cv.string,
17  vol.Optional(CONF_SEND_COMMAND_TOPIC): valid_publish_topic,
18  vol.Optional(CONF_SET_FAN_SPEED_TOPIC): valid_publish_topic,
19  vol.Optional(CONF_STATE_TOPIC): valid_publish_topic,
20  vol.Optional(CONF_SUPPORTED_FEATURES, default=DEFAULT_SERVICE_STRINGS): vol.All(
21  cv.ensure_list, [vol.In(STRING_TO_SERVICE.keys())]
22  ),
23  vol.Optional(CONF_COMMAND_TOPIC): valid_publish_topic,
24  vol.Optional(CONF_RETAIN, default=DEFAULT_RETAIN): cv.boolean,
25  }
26 ).extend(MQTT_ENTITY_COMMON_SCHEMA.schema)

Definition at line 146 of file vacuum.py.

◆ STATE

string homeassistant.components.mqtt.vacuum.STATE = "state"

Definition at line 46 of file vacuum.py.

◆ STRING_TO_SERVICE

dictionary homeassistant.components.mqtt.vacuum.STRING_TO_SERVICE = {v: k for k, v in SERVICE_TO_STRING.items()}

Definition at line 95 of file vacuum.py.