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
2 changes: 1 addition & 1 deletion homeassistant/components/esphome/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"mqtt": ["esphome/discover/#"],
"quality_scale": "platinum",
"requirements": [
"aioesphomeapi==41.3.0",
"aioesphomeapi==41.4.0",
"esphome-dashboard-api==1.3.0",
"bleak-esphome==3.3.0"
],
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/honeywell/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"message": "Honeywell set temperature failed: invalid temperature {temperature}"
},
"temp_failed_range": {
"message": "Honeywell set temperature failed: temperature out of range. Mode: {mode}, Heat Temperuature: {heat}, Cool Temperature: {cool}"
"message": "Honeywell set temperature failed: temperature out of range. Mode: {mode}, Heat temperature: {heat}, Cool temperature: {cool}"
},
"set_hold_failed": {
"message": "Honeywell could not set permanent hold"
Expand Down
7 changes: 7 additions & 0 deletions homeassistant/components/number/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,12 @@ class NumberDeviceClass(StrEnum):
Unit of measurement: `μg/m³`
"""

PM4 = "pm4"
"""Particulate matter <= 4 μm.

Unit of measurement: `μg/m³`
"""

POWER_FACTOR = "power_factor"
"""Power factor.

Expand Down Expand Up @@ -510,6 +516,7 @@ class NumberDeviceClass(StrEnum):
NumberDeviceClass.PM1: {CONCENTRATION_MICROGRAMS_PER_CUBIC_METER},
NumberDeviceClass.PM10: {CONCENTRATION_MICROGRAMS_PER_CUBIC_METER},
NumberDeviceClass.PM25: {CONCENTRATION_MICROGRAMS_PER_CUBIC_METER},
NumberDeviceClass.PM4: {CONCENTRATION_MICROGRAMS_PER_CUBIC_METER},
NumberDeviceClass.POWER_FACTOR: {PERCENTAGE, None},
NumberDeviceClass.POWER: {
UnitOfPower.MILLIWATT,
Expand Down
8 changes: 8 additions & 0 deletions homeassistant/components/sensor/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,12 @@ class SensorDeviceClass(StrEnum):
Unit of measurement: `μg/m³`
"""

PM4 = "pm4"
"""Particulate matter <= 4 μm.

Unit of measurement: `μg/m³`
"""

POWER_FACTOR = "power_factor"
"""Power factor.

Expand Down Expand Up @@ -621,6 +627,7 @@ class SensorStateClass(StrEnum):
SensorDeviceClass.PM1: {CONCENTRATION_MICROGRAMS_PER_CUBIC_METER},
SensorDeviceClass.PM10: {CONCENTRATION_MICROGRAMS_PER_CUBIC_METER},
SensorDeviceClass.PM25: {CONCENTRATION_MICROGRAMS_PER_CUBIC_METER},
SensorDeviceClass.PM4: {CONCENTRATION_MICROGRAMS_PER_CUBIC_METER},
SensorDeviceClass.POWER_FACTOR: {PERCENTAGE, None},
SensorDeviceClass.POWER: {
UnitOfPower.MILLIWATT,
Expand Down Expand Up @@ -755,6 +762,7 @@ class SensorStateClass(StrEnum):
SensorDeviceClass.PM1: {SensorStateClass.MEASUREMENT},
SensorDeviceClass.PM10: {SensorStateClass.MEASUREMENT},
SensorDeviceClass.PM25: {SensorStateClass.MEASUREMENT},
SensorDeviceClass.PM4: {SensorStateClass.MEASUREMENT},
SensorDeviceClass.POWER_FACTOR: {SensorStateClass.MEASUREMENT},
SensorDeviceClass.POWER: {SensorStateClass.MEASUREMENT},
SensorDeviceClass.PRECIPITATION: set(SensorStateClass),
Expand Down
3 changes: 3 additions & 0 deletions homeassistant/components/sensor/device_condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
CONF_IS_PM1 = "is_pm1"
CONF_IS_PM10 = "is_pm10"
CONF_IS_PM25 = "is_pm25"
CONF_IS_PM4 = "is_pm4"
CONF_IS_POWER = "is_power"
CONF_IS_POWER_FACTOR = "is_power_factor"
CONF_IS_PRECIPITATION = "is_precipitation"
Expand Down Expand Up @@ -126,6 +127,7 @@
SensorDeviceClass.PM1: [{CONF_TYPE: CONF_IS_PM1}],
SensorDeviceClass.PM10: [{CONF_TYPE: CONF_IS_PM10}],
SensorDeviceClass.PM25: [{CONF_TYPE: CONF_IS_PM25}],
SensorDeviceClass.PM4: [{CONF_TYPE: CONF_IS_PM4}],
SensorDeviceClass.PRECIPITATION: [{CONF_TYPE: CONF_IS_PRECIPITATION}],
SensorDeviceClass.PRECIPITATION_INTENSITY: [
{CONF_TYPE: CONF_IS_PRECIPITATION_INTENSITY}
Expand Down Expand Up @@ -195,6 +197,7 @@
CONF_IS_PM1,
CONF_IS_PM10,
CONF_IS_PM25,
CONF_IS_PM4,
CONF_IS_PRECIPITATION,
CONF_IS_PRECIPITATION_INTENSITY,
CONF_IS_PRESSURE,
Expand Down
3 changes: 3 additions & 0 deletions homeassistant/components/sensor/device_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
CONF_PM1 = "pm1"
CONF_PM10 = "pm10"
CONF_PM25 = "pm25"
CONF_PM4 = "pm4"
CONF_POWER = "power"
CONF_POWER_FACTOR = "power_factor"
CONF_PRECIPITATION = "precipitation"
Expand Down Expand Up @@ -123,6 +124,7 @@
SensorDeviceClass.PM1: [{CONF_TYPE: CONF_PM1}],
SensorDeviceClass.PM10: [{CONF_TYPE: CONF_PM10}],
SensorDeviceClass.PM25: [{CONF_TYPE: CONF_PM25}],
SensorDeviceClass.PM4: [{CONF_TYPE: CONF_PM4}],
SensorDeviceClass.POWER: [{CONF_TYPE: CONF_POWER}],
SensorDeviceClass.POWER_FACTOR: [{CONF_TYPE: CONF_POWER_FACTOR}],
SensorDeviceClass.PRECIPITATION: [{CONF_TYPE: CONF_PRECIPITATION}],
Expand Down Expand Up @@ -193,6 +195,7 @@
CONF_PM1,
CONF_PM10,
CONF_PM25,
CONF_PM4,
CONF_POWER,
CONF_POWER_FACTOR,
CONF_PRECIPITATION,
Expand Down
2 changes: 2 additions & 0 deletions homeassistant/components/sensor/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"is_pm1": "Current {entity_name} PM1 concentration level",
"is_pm10": "Current {entity_name} PM10 concentration level",
"is_pm25": "Current {entity_name} PM2.5 concentration level",
"is_pm4": "Current {entity_name} PM4 concentration level",
"is_power": "Current {entity_name} power",
"is_power_factor": "Current {entity_name} power factor",
"is_precipitation": "Current {entity_name} precipitation",
Expand Down Expand Up @@ -90,6 +91,7 @@
"pm1": "{entity_name} PM1 concentration changes",
"pm10": "{entity_name} PM10 concentration changes",
"pm25": "{entity_name} PM2.5 concentration changes",
"pm4": "{entity_name} PM4 concentration changes",
"power": "{entity_name} power changes",
"power_factor": "{entity_name} power factor changes",
"precipitation": "{entity_name} precipitation changes",
Expand Down
9 changes: 6 additions & 3 deletions homeassistant/components/shelly/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,12 @@ def __init__(
) -> None:
"""Initialize light."""
super().__init__(coordinator, key, attribute, description)
color_temp_range = coordinator.device.config[f"cct:{self._id}"]["ct_range"]
self._attr_min_color_temp_kelvin = color_temp_range[0]
self._attr_max_color_temp_kelvin = color_temp_range[1]
if color_temp_range := coordinator.device.config[key].get("ct_range"):
self._attr_min_color_temp_kelvin = color_temp_range[0]
self._attr_max_color_temp_kelvin = color_temp_range[1]
else:
self._attr_min_color_temp_kelvin = KELVIN_MIN_VALUE_WHITE
self._attr_max_color_temp_kelvin = KELVIN_MAX_VALUE

@property
def color_temp_kelvin(self) -> int:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/system_bridge/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"integration_type": "device",
"iot_class": "local_push",
"loggers": ["systembridgeconnector"],
"requirements": ["systembridgeconnector==4.1.10"],
"requirements": ["systembridgeconnector==5.1.0"],
"zeroconf": ["_system-bridge._tcp.local."]
}
4 changes: 2 additions & 2 deletions requirements_all.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions requirements_test_all.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/components/esphome/snapshots/test_diagnostics.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
'uses_password': False,
'voice_assistant_feature_flags': 0,
'webserver_port': 0,
'zwave_home_id': 0,
'zwave_proxy_feature_flags': 0,
}),
'services': list([
Expand Down
1 change: 1 addition & 0 deletions tests/components/esphome/test_diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ async def test_diagnostics_with_bluetooth(
"legacy_voice_assistant_version": 0,
"voice_assistant_feature_flags": 0,
"webserver_port": 0,
"zwave_home_id": 0,
"zwave_proxy_feature_flags": 0,
},
"services": [],
Expand Down
1 change: 1 addition & 0 deletions tests/components/sensor/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
SensorDeviceClass.PM10: CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
SensorDeviceClass.PM1: CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
SensorDeviceClass.PM25: CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
SensorDeviceClass.PM4: CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
SensorDeviceClass.POWER: UnitOfPower.KILO_WATT,
SensorDeviceClass.POWER_FACTOR: PERCENTAGE,
SensorDeviceClass.PRECIPITATION: UnitOfPrecipitationDepth.MILLIMETERS,
Expand Down
2 changes: 1 addition & 1 deletion tests/components/sensor/test_device_condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ async def test_get_conditions(
conditions = await async_get_device_automations(
hass, DeviceAutomationType.CONDITION, device_entry.id
)
assert len(conditions) == 55
assert len(conditions) == 56
assert conditions == unordered(expected_conditions)


Expand Down
2 changes: 1 addition & 1 deletion tests/components/sensor/test_device_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ async def test_get_triggers(
triggers = await async_get_device_automations(
hass, DeviceAutomationType.TRIGGER, device_entry.id
)
assert len(triggers) == 55
assert len(triggers) == 56
assert triggers == unordered(expected_triggers)


Expand Down
2 changes: 2 additions & 0 deletions tests/components/sensor/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -2158,6 +2158,7 @@ async def test_non_numeric_device_class_with_unit_of_measurement(
SensorDeviceClass.PM1,
SensorDeviceClass.PM10,
SensorDeviceClass.PM25,
SensorDeviceClass.PM4,
SensorDeviceClass.POWER_FACTOR,
SensorDeviceClass.POWER,
SensorDeviceClass.PRECIPITATION_INTENSITY,
Expand Down Expand Up @@ -3024,6 +3025,7 @@ def test_device_class_converters_are_complete() -> None:
SensorDeviceClass.PM1,
SensorDeviceClass.PM10,
SensorDeviceClass.PM25,
SensorDeviceClass.PM4,
SensorDeviceClass.SIGNAL_STRENGTH,
SensorDeviceClass.SOUND_PRESSURE,
SensorDeviceClass.SULPHUR_DIOXIDE,
Expand Down
26 changes: 26 additions & 0 deletions tests/components/shelly/test_light.py
Original file line number Diff line number Diff line change
Expand Up @@ -927,3 +927,29 @@ async def test_rpc_remove_cct_light(

# there is no cct:0 in the status, so the CCT light entity should be removed
assert get_entity(hass, LIGHT_DOMAIN, "cct:0") is None


async def test_rpc_cct_light_without_ct_range(
hass: HomeAssistant,
mock_rpc_device: Mock,
monkeypatch: pytest.MonkeyPatch,
) -> None:
"""Test RPC CCT light without ct_range in the light config."""
entity_id = f"{LIGHT_DOMAIN}.living_room_lamp"

config = deepcopy(mock_rpc_device.config)
config["cct:0"] = {"id": 0, "name": "Living room lamp"}
monkeypatch.setattr(mock_rpc_device, "config", config)

status = deepcopy(mock_rpc_device.status)
status["cct:0"] = {"id": 0, "output": False, "brightness": 77, "ct": 3666}
monkeypatch.setattr(mock_rpc_device, "status", status)

await init_integration(hass, 3)

assert (state := hass.states.get(entity_id))
assert state.state == STATE_OFF

# default values from constants are 2700 and 6500
assert state.attributes[ATTR_MIN_COLOR_TEMP_KELVIN] == 2700
assert state.attributes[ATTR_MAX_COLOR_TEMP_KELVIN] == 6500
Loading