Skip to content

Commit

Permalink
Bump hatasmota to 0.9.2 (home-assistant#120670)
Browse files Browse the repository at this point in the history
  • Loading branch information
emontnemery authored Jun 27, 2024
1 parent bccd5c8 commit f3761a8
Show file tree
Hide file tree
Showing 6 changed files with 224 additions and 52 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/tasmota/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"iot_class": "local_push",
"loggers": ["hatasmota"],
"mqtt": ["tasmota/discovery/#"],
"requirements": ["HATasmota==0.9.1"]
"requirements": ["HATasmota==0.9.2"]
}
78 changes: 41 additions & 37 deletions homeassistant/components/tasmota/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,10 @@
# A Tasmota sensor type may be mapped to either a device class or an icon,
# both can only be set if the default device class icon is not appropriate
SENSOR_DEVICE_CLASS_ICON_MAP: dict[str, dict[str, Any]] = {
hc.SENSOR_ACTIVE_ENERGYEXPORT: {
DEVICE_CLASS: SensorDeviceClass.ENERGY,
STATE_CLASS: SensorStateClass.TOTAL,
},
hc.SENSOR_ACTIVE_ENERGYIMPORT: {
DEVICE_CLASS: SensorDeviceClass.ENERGY,
STATE_CLASS: SensorStateClass.TOTAL,
},
hc.SENSOR_ACTIVE_POWERUSAGE: {
DEVICE_CLASS: SensorDeviceClass.POWER,
STATE_CLASS: SensorStateClass.MEASUREMENT,
},
hc.SENSOR_AMBIENT: {
DEVICE_CLASS: SensorDeviceClass.ILLUMINANCE,
STATE_CLASS: SensorStateClass.MEASUREMENT,
},
hc.SENSOR_APPARENT_POWERUSAGE: {
DEVICE_CLASS: SensorDeviceClass.APPARENT_POWER,
STATE_CLASS: SensorStateClass.MEASUREMENT,
},
hc.SENSOR_BATTERY: {
DEVICE_CLASS: SensorDeviceClass.BATTERY,
STATE_CLASS: SensorStateClass.MEASUREMENT,
Expand All @@ -92,7 +76,7 @@
DEVICE_CLASS: SensorDeviceClass.CURRENT,
STATE_CLASS: SensorStateClass.MEASUREMENT,
},
hc.SENSOR_CURRENTNEUTRAL: {
hc.SENSOR_CURRENT_NEUTRAL: {
DEVICE_CLASS: SensorDeviceClass.CURRENT,
STATE_CLASS: SensorStateClass.MEASUREMENT,
},
Expand All @@ -110,6 +94,34 @@
DEVICE_CLASS: SensorDeviceClass.ENERGY,
STATE_CLASS: SensorStateClass.TOTAL,
},
hc.SENSOR_ENERGY_EXPORT_ACTIVE: {
DEVICE_CLASS: SensorDeviceClass.ENERGY,
STATE_CLASS: SensorStateClass.TOTAL,
},
hc.SENSOR_ENERGY_EXPORT_REACTIVE: {STATE_CLASS: SensorStateClass.TOTAL},
hc.SENSOR_ENERGY_EXPORT_TARIFF: {
DEVICE_CLASS: SensorDeviceClass.ENERGY,
STATE_CLASS: SensorStateClass.TOTAL,
},
hc.SENSOR_ENERGY_IMPORT_ACTIVE: {
DEVICE_CLASS: SensorDeviceClass.ENERGY,
STATE_CLASS: SensorStateClass.TOTAL,
},
hc.SENSOR_ENERGY_IMPORT_REACTIVE: {STATE_CLASS: SensorStateClass.TOTAL},
hc.SENSOR_ENERGY_IMPORT_TODAY: {
DEVICE_CLASS: SensorDeviceClass.ENERGY,
STATE_CLASS: SensorStateClass.TOTAL_INCREASING,
},
hc.SENSOR_ENERGY_IMPORT_TOTAL: {
DEVICE_CLASS: SensorDeviceClass.ENERGY,
STATE_CLASS: SensorStateClass.TOTAL,
},
hc.SENSOR_ENERGY_IMPORT_TOTAL_TARIFF: {
DEVICE_CLASS: SensorDeviceClass.ENERGY,
STATE_CLASS: SensorStateClass.TOTAL,
},
hc.SENSOR_ENERGY_IMPORT_YESTERDAY: {DEVICE_CLASS: SensorDeviceClass.ENERGY},
hc.SENSOR_ENERGY_TOTAL_START_TIME: {ICON: "mdi:progress-clock"},
hc.SENSOR_FREQUENCY: {
DEVICE_CLASS: SensorDeviceClass.FREQUENCY,
STATE_CLASS: SensorStateClass.MEASUREMENT,
Expand All @@ -122,6 +134,14 @@
DEVICE_CLASS: SensorDeviceClass.ILLUMINANCE,
STATE_CLASS: SensorStateClass.MEASUREMENT,
},
hc.SENSOR_POWER_ACTIVE: {
DEVICE_CLASS: SensorDeviceClass.POWER,
STATE_CLASS: SensorStateClass.MEASUREMENT,
},
hc.SENSOR_POWER_APPARENT: {
DEVICE_CLASS: SensorDeviceClass.APPARENT_POWER,
STATE_CLASS: SensorStateClass.MEASUREMENT,
},
hc.SENSOR_STATUS_IP: {ICON: "mdi:ip-network"},
hc.SENSOR_STATUS_LINK_COUNT: {ICON: "mdi:counter"},
hc.SENSOR_MOISTURE: {DEVICE_CLASS: SensorDeviceClass.MOISTURE},
Expand All @@ -144,26 +164,24 @@
DEVICE_CLASS: SensorDeviceClass.PM25,
STATE_CLASS: SensorStateClass.MEASUREMENT,
},
hc.SENSOR_POWERFACTOR: {
hc.SENSOR_POWER_FACTOR: {
DEVICE_CLASS: SensorDeviceClass.POWER_FACTOR,
STATE_CLASS: SensorStateClass.MEASUREMENT,
},
hc.SENSOR_POWERUSAGE: {
hc.SENSOR_POWER: {
DEVICE_CLASS: SensorDeviceClass.POWER,
STATE_CLASS: SensorStateClass.MEASUREMENT,
},
hc.SENSOR_PRESSURE: {
DEVICE_CLASS: SensorDeviceClass.PRESSURE,
STATE_CLASS: SensorStateClass.MEASUREMENT,
},
hc.SENSOR_PRESSUREATSEALEVEL: {
hc.SENSOR_PRESSURE_AT_SEA_LEVEL: {
DEVICE_CLASS: SensorDeviceClass.PRESSURE,
STATE_CLASS: SensorStateClass.MEASUREMENT,
},
hc.SENSOR_PROXIMITY: {ICON: "mdi:ruler"},
hc.SENSOR_REACTIVE_ENERGYEXPORT: {STATE_CLASS: SensorStateClass.TOTAL},
hc.SENSOR_REACTIVE_ENERGYIMPORT: {STATE_CLASS: SensorStateClass.TOTAL},
hc.SENSOR_REACTIVE_POWERUSAGE: {
hc.SENSOR_POWER_REACTIVE: {
DEVICE_CLASS: SensorDeviceClass.REACTIVE_POWER,
STATE_CLASS: SensorStateClass.MEASUREMENT,
},
Expand All @@ -182,19 +200,6 @@
DEVICE_CLASS: SensorDeviceClass.TEMPERATURE,
STATE_CLASS: SensorStateClass.MEASUREMENT,
},
hc.SENSOR_TODAY: {
DEVICE_CLASS: SensorDeviceClass.ENERGY,
STATE_CLASS: SensorStateClass.TOTAL_INCREASING,
},
hc.SENSOR_TOTAL: {
DEVICE_CLASS: SensorDeviceClass.ENERGY,
STATE_CLASS: SensorStateClass.TOTAL,
},
hc.SENSOR_TOTAL_TARIFF: {
DEVICE_CLASS: SensorDeviceClass.ENERGY,
STATE_CLASS: SensorStateClass.TOTAL,
},
hc.SENSOR_TOTAL_START_TIME: {ICON: "mdi:progress-clock"},
hc.SENSOR_TVOC: {ICON: "mdi:air-filter"},
hc.SENSOR_VOLTAGE: {
DEVICE_CLASS: SensorDeviceClass.VOLTAGE,
Expand All @@ -204,7 +209,6 @@
DEVICE_CLASS: SensorDeviceClass.WEIGHT,
STATE_CLASS: SensorStateClass.MEASUREMENT,
},
hc.SENSOR_YESTERDAY: {DEVICE_CLASS: SensorDeviceClass.ENERGY},
}

SENSOR_UNIT_MAP = {
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ DoorBirdPy==2.1.0
HAP-python==4.9.1

# homeassistant.components.tasmota
HATasmota==0.9.1
HATasmota==0.9.2

# homeassistant.components.mastodon
Mastodon.py==1.8.1
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ DoorBirdPy==2.1.0
HAP-python==4.9.1

# homeassistant.components.tasmota
HATasmota==0.9.1
HATasmota==0.9.2

# homeassistant.components.doods
# homeassistant.components.generic
Expand Down
Loading

0 comments on commit f3761a8

Please sign in to comment.