Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EveWeather Pressure and Altitude attributes #123565

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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/matter/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"dependencies": ["websocket_api"],
"documentation": "https://www.home-assistant.io/integrations/matter",
"iot_class": "local_push",
"requirements": ["python-matter-server==6.3.0"],
"requirements": ["python-matter-server==6.5.0b0"],
lboue marked this conversation as resolved.
Show resolved Hide resolved
lboue marked this conversation as resolved.
Show resolved Hide resolved
"zeroconf": ["_matter._tcp.local.", "_matterc._udp.local."]
}
18 changes: 17 additions & 1 deletion homeassistant/components/matter/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from dataclasses import dataclass

from chip.clusters import Objects as clusters
from matter_server.common.custom_clusters import EveCluster
from matter_server.common.helpers.util import create_attribute_path_from_attribute

from homeassistant.components.number import (
Expand All @@ -13,7 +14,7 @@
NumberMode,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import EntityCategory, Platform, UnitOfTime
from homeassistant.const import EntityCategory, Platform, UnitOfLength, UnitOfTime
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_platform import AddEntitiesCallback

Expand Down Expand Up @@ -137,4 +138,19 @@ def _update_from_device(self) -> None:
entity_class=MatterNumber,
required_attributes=(clusters.LevelControl.Attributes.OnOffTransitionTime,),
),
MatterDiscoverySchema(
platform=Platform.NUMBER,
entity_description=MatterNumberEntityDescription(
key="EveWeatherAltitude",
entity_category=EntityCategory.CONFIG,
translation_key="altitude",
native_max_value=9000,
native_min_value=0,
native_unit_of_measurement=UnitOfLength.METERS,
native_step=1,
mode=NumberMode.BOX,
),
entity_class=MatterNumber,
required_attributes=(EveCluster.Attributes.Altitude,),
),
]
12 changes: 12 additions & 0 deletions homeassistant/components/matter/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,4 +462,16 @@ def _update_from_device(self) -> None:
required_attributes=(clusters.Switch.Attributes.CurrentPosition,),
allow_multi=True, # also used for event entity
),
MatterDiscoverySchema(
platform=Platform.SENSOR,
entity_description=MatterSensorEntityDescription(
key="EveWeatherPressure",
device_class=SensorDeviceClass.PRESSURE,
native_unit_of_measurement=UnitOfPressure.HPA,
suggested_display_precision=0,
state_class=SensorStateClass.MEASUREMENT,
),
entity_class=MatterSensor,
required_attributes=(EveCluster.Attributes.Pressure,),
),
]
3 changes: 3 additions & 0 deletions homeassistant/components/matter/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@
},
"on_off_transition_time": {
"name": "On/Off transition time"
},
"altitude": {
"name": "Altitude above Sea Level"
}
},
"light": {
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2322,7 +2322,7 @@ python-linkplay==0.0.8
# python-lirc==1.2.3

# homeassistant.components.matter
python-matter-server==6.3.0
python-matter-server==6.5.0b0

# homeassistant.components.xiaomi_miio
python-miio==0.5.12
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1837,7 +1837,7 @@ python-kasa[speedups]==0.7.1
python-linkplay==0.0.8

# homeassistant.components.matter
python-matter-server==6.3.0
python-matter-server==6.5.0b0

# homeassistant.components.xiaomi_miio
python-miio==0.5.12
Expand Down
Loading