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
19 changes: 16 additions & 3 deletions homeassistant/components/climacell/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
HealthConcernType,
PollenIndex,
PrimaryPollutantType,
V3PollenIndex,
WeatherCode,
)

Expand Down Expand Up @@ -307,8 +308,20 @@
ATTR_FIELD: CC_V3_ATTR_CHINA_HEALTH_CONCERN,
ATTR_NAME: "China MEP Health Concern",
},
{ATTR_FIELD: CC_V3_ATTR_POLLEN_TREE, ATTR_NAME: "Tree Pollen Index"},
{ATTR_FIELD: CC_V3_ATTR_POLLEN_WEED, ATTR_NAME: "Weed Pollen Index"},
{ATTR_FIELD: CC_V3_ATTR_POLLEN_GRASS, ATTR_NAME: "Grass Pollen Index"},
{
ATTR_FIELD: CC_V3_ATTR_POLLEN_TREE,
ATTR_NAME: "Tree Pollen Index",
ATTR_VALUE_MAP: V3PollenIndex,
},
{
ATTR_FIELD: CC_V3_ATTR_POLLEN_WEED,
ATTR_NAME: "Weed Pollen Index",
ATTR_VALUE_MAP: V3PollenIndex,
},
{
ATTR_FIELD: CC_V3_ATTR_POLLEN_GRASS,
ATTR_NAME: "Grass Pollen Index",
ATTR_VALUE_MAP: V3PollenIndex,
},
{ATTR_FIELD: CC_V3_ATTR_FIRE_INDEX, ATTR_NAME: "Fire Index"},
]
2 changes: 1 addition & 1 deletion homeassistant/components/climacell/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "ClimaCell",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/climacell",
"requirements": ["pyclimacell==0.18.0"],
"requirements": ["pyclimacell==0.18.2"],
"codeowners": ["@raman325"],
"iot_class": "cloud_polling"
}
2 changes: 1 addition & 1 deletion homeassistant/components/climacell/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def state(self) -> str | int | float | None:
):
return round(self._state * self.sensor_type[ATTR_METRIC_CONVERSION], 4)

if ATTR_VALUE_MAP in self.sensor_type:
if ATTR_VALUE_MAP in self.sensor_type and self._state is not None:
return self.sensor_type[ATTR_VALUE_MAP](self._state).name.lower()
return self._state

Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,7 @@ pychromecast==9.1.2
pycketcasts==1.0.0

# homeassistant.components.climacell
pyclimacell==0.18.0
pyclimacell==0.18.2

# homeassistant.components.cmus
pycmus==0.1.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 @@ -720,7 +720,7 @@ pycfdns==1.2.1
pychromecast==9.1.2

# homeassistant.components.climacell
pyclimacell==0.18.0
pyclimacell==0.18.2

# homeassistant.components.comfoconnect
pycomfoconnect==0.4
Expand Down
6 changes: 3 additions & 3 deletions tests/components/climacell/test_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ async def test_v3_sensor(
check_sensor_state(hass, EPA_HEALTH_CONCERN, "Good")
check_sensor_state(hass, EPA_PRIMARY_POLLUTANT, "pm25")
check_sensor_state(hass, FIRE_INDEX, "9")
check_sensor_state(hass, GRASS_POLLEN, "0")
check_sensor_state(hass, WEED_POLLEN, "0")
check_sensor_state(hass, TREE_POLLEN, "0")
check_sensor_state(hass, GRASS_POLLEN, "minimal_to_none")
check_sensor_state(hass, WEED_POLLEN, "minimal_to_none")
check_sensor_state(hass, TREE_POLLEN, "minimal_to_none")


async def test_v4_sensor(
Expand Down