Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 18 additions & 27 deletions homeassistant/components/rfxtrx/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,12 @@ class RfxtrxSensorEntityDescription(SensorEntityDescription):
SENSOR_TYPES = (
RfxtrxSensorEntityDescription(
key="Barometer",
name="Barometer",
device_class=SensorDeviceClass.PRESSURE,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfPressure.HPA,
),
RfxtrxSensorEntityDescription(
key="Battery numeric",
name="Battery",
device_class=SensorDeviceClass.BATTERY,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=PERCENTAGE,
Expand All @@ -86,49 +84,46 @@ class RfxtrxSensorEntityDescription(SensorEntityDescription):
),
RfxtrxSensorEntityDescription(
key="Current",
name="Current",
device_class=SensorDeviceClass.CURRENT,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
),
RfxtrxSensorEntityDescription(
key="Current Ch. 1",
name="Current Ch. 1",
translation_key="current_ch_1",
device_class=SensorDeviceClass.CURRENT,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
),
RfxtrxSensorEntityDescription(
key="Current Ch. 2",
name="Current Ch. 2",
translation_key="current_ch_2",
device_class=SensorDeviceClass.CURRENT,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
),
RfxtrxSensorEntityDescription(
key="Current Ch. 3",
name="Current Ch. 3",
translation_key="current_ch_3",
device_class=SensorDeviceClass.CURRENT,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
),
RfxtrxSensorEntityDescription(
key="Energy usage",
name="Instantaneous power",
translation_key="instantaneous_power",
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfPower.WATT,
),
RfxtrxSensorEntityDescription(
key="Humidity",
name="Humidity",
device_class=SensorDeviceClass.HUMIDITY,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=PERCENTAGE,
),
RfxtrxSensorEntityDescription(
key="Rssi numeric",
name="Signal strength",
device_class=SensorDeviceClass.SIGNAL_STRENGTH,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
Expand All @@ -137,108 +132,104 @@ class RfxtrxSensorEntityDescription(SensorEntityDescription):
),
RfxtrxSensorEntityDescription(
key="Temperature",
name="Temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
),
RfxtrxSensorEntityDescription(
key="Temperature2",
name="Temperature 2",
translation_key="temperature_2",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
),
RfxtrxSensorEntityDescription(
key="Total usage",
name="Total energy usage",
translation_key="total_energy_usage",
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
),
RfxtrxSensorEntityDescription(
key="Voltage",
name="Voltage",
device_class=SensorDeviceClass.VOLTAGE,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
),
RfxtrxSensorEntityDescription(
key="Wind direction",
name="Wind direction",
translation_key="wind_direction",
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=DEGREE,
),
RfxtrxSensorEntityDescription(
key="Rain rate",
name="Rain rate",
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfVolumetricFlux.MILLIMETERS_PER_HOUR,
device_class=SensorDeviceClass.PRECIPITATION_INTENSITY,
),
RfxtrxSensorEntityDescription(
key="Sound",
name="Sound",
translation_key="sound",
),
RfxtrxSensorEntityDescription(
key="Sensor Status",
name="Sensor status",
translation_key="sensor_status",
),
RfxtrxSensorEntityDescription(
key="Count",
name="Count",
translation_key="count",
state_class=SensorStateClass.TOTAL_INCREASING,
native_unit_of_measurement="count",
),
RfxtrxSensorEntityDescription(
key="Counter value",
name="Counter value",
translation_key="counter_value",
state_class=SensorStateClass.TOTAL_INCREASING,
native_unit_of_measurement="count",
),
RfxtrxSensorEntityDescription(
key="Chill",
name="Chill",
translation_key="chill",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
),
RfxtrxSensorEntityDescription(
key="Wind average speed",
name="Wind average speed",
translation_key="wind_average_speed",
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfSpeed.METERS_PER_SECOND,
device_class=SensorDeviceClass.WIND_SPEED,
),
RfxtrxSensorEntityDescription(
key="Wind gust",
name="Wind gust",
translation_key="wind_gust",
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfSpeed.METERS_PER_SECOND,
device_class=SensorDeviceClass.WIND_SPEED,
),
RfxtrxSensorEntityDescription(
key="Rain total",
name="Rain total",
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfPrecipitationDepth.MILLIMETERS,
device_class=SensorDeviceClass.PRECIPITATION,
),
RfxtrxSensorEntityDescription(
key="Forecast",
name="Forecast status",
translation_key="forecast_status",
),
RfxtrxSensorEntityDescription(
key="Forecast numeric",
name="Forecast",
translation_key="forecast",
),
RfxtrxSensorEntityDescription(
key="Humidity status",
name="Humidity status",
translation_key="humidity_status",
),
RfxtrxSensorEntityDescription(
key="UV",
name="UV index",
translation_key="uv_index",
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UV_INDEX,
),
Expand Down
58 changes: 58 additions & 0 deletions homeassistant/components/rfxtrx/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,63 @@
"status": "Received status: {subtype}",
"command": "Received command: {subtype}"
}
},
"entity": {
"sensor": {
"current_ch_1": {
"name": "Current Ch. 1"
},
"current_ch_2": {
"name": "Current Ch. 2"
},
"current_ch_3": {
"name": "Current Ch. 3"
},
"instantaneous_power": {
"name": "Instantaneous power"
},
"temperature_2": {
"name": "Temperature 2"
},
"total_energy_usage": {
"name": "Total energy usage"
},
"wind_direction": {
"name": "Wind direction"
},
"sound": {
"name": "Sound"
},
"sensor_status": {
"name": "Sensor status"
},
"count": {
"name": "Count"
},
"counter_value": {
"name": "Counter value"
},
"chill": {
"name": "Chill"
},
"wind_average_speed": {
"name": "Wind average speed"
},
"wind_gust": {
"name": "Wind gust"
},
"forecast_status": {
"name": "Forecast status"
},
"forecast": {
"name": "Forecast"
},
"humidity_status": {
"name": "Humidity status"
},
"uv_index": {
"name": "UV index"
}
}
}
}