Skip to content

Commit

Permalink
use correct device info keys according to ha core 2023.8
Browse files Browse the repository at this point in the history
  • Loading branch information
kcofoni committed Aug 4, 2023
1 parent 14534b6 commit 00653aa
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions custom_components/netro_watering/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
NETRO_MOISTURE_DATE = "date"
NETRO_MOISTURE_MOISTURE = "moisture"

EXTRA_STATE_ATTRIBUTE_SEP_LEFT = "------------------------------"
EXTRA_STATE_ATTRIBUTE_SEP_RIGHT = "------------------------------"
EXTRA_STATE_ATTRIBUTE_SEP_LEFT = "-------------------------"
EXTRA_STATE_ATTRIBUTE_SEP_RIGHT = "-------------------------"

GLOBAL_PARAMETERS = "parameters"

Expand Down
12 changes: 6 additions & 6 deletions custom_components/netro_watering/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,12 @@ def __init__(
def device_info(self) -> DeviceInfo:
"""Return information about the device."""
return DeviceInfo(
default_name=f"{self.device_name}",
name=f"{self.device_name}",
identifiers={(DOMAIN, self.serial_number)},
manufacturer=MANUFACTURER,
hw_version=self.hw_version,
sw_version=self.sw_version,
default_model=NETRO_DEFAULT_SENSOR_MODEL,
model=NETRO_DEFAULT_SENSOR_MODEL,
)

@property
Expand Down Expand Up @@ -424,12 +424,12 @@ def token_remaining(self) -> int | None:
def device_info(self) -> DeviceInfo:
"""Return information about the zone as a device. To be used when creating related entities."""
return DeviceInfo(
default_name=f"{self.name}"
name=f"{self.name}"
if self.name # if name is not set this is a Pixie and so we concatenate the controller name and the index of the zone
else f"{self.parent_controller.name} {self.ith}",
identifiers={(DOMAIN, self.serial_number)},
manufacturer=MANUFACTURER,
default_model=NETRO_DEFAULT_ZONE_MODEL,
model=NETRO_DEFAULT_ZONE_MODEL,
via_device=(DOMAIN, self.parent_controller.serial_number),
)

Expand Down Expand Up @@ -476,12 +476,12 @@ def __init__(
def device_info(self) -> DeviceInfo:
"""Return information about the controller as a device. To be used when creating related entities."""
return DeviceInfo(
default_name=f"{self.device_name}",
name=f"{self.device_name}",
identifiers={(DOMAIN, self.serial_number)},
manufacturer=MANUFACTURER,
hw_version=self.hw_version,
sw_version=self.sw_version,
default_model=NETRO_PIXIE_CONTROLLER_MODEL
model=NETRO_PIXIE_CONTROLLER_MODEL
if hasattr(self, NETRO_CONTROLLER_BATTERY_LEVEL)
else NETRO_SPRITE_CONTROLLER_MODEL,
)
Expand Down
2 changes: 1 addition & 1 deletion custom_components/netro_watering/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"validators==0.20.0"
],
"ssdp": [],
"version": "1.1.2",
"version": "1.1.3",
"zeroconf": []
}
2 changes: 1 addition & 1 deletion custom_components/netro_watering/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class NetroSwitchEntityDescription(SwitchEntityDescription, NetroRequiredKeysMix
icon="mdi:sprinkler",
)

# description of the start/stop watering switch
# description of the enable/disable switch
NETRO_ENABLED_SWITCH_DESCRIPTION = SwitchEntityDescription(
key="enabled",
name="Enabled",
Expand Down
4 changes: 2 additions & 2 deletions custom_components/netro_watering/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"iswatering": {
"name": "Is it watering right now ?",
"state": {
"off": "No",
"on": "Yes"
"off": "off",
"on": "on"
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions custom_components/netro_watering/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"iswatering": {
"name": "¿Está regando ahora?",
"state": {
"off": "No",
"on": ""
"off": "inactivo",
"on": "activo"
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions custom_components/netro_watering/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@
"iswatering": {
"name": "Arrosage en cours ?",
"state": {
"on": "Oui",
"off": "Non"
"on": "actif",
"off": "inactif"
}
}
}
Expand Down

0 comments on commit 00653aa

Please sign in to comment.