Skip to content

Commit add4421

Browse files
authored
Remove incorrect or too restrictive validations (#355)
* Remove validation of ChargerLocalSettings-response * Remove AuthenticationType requirement from Installation-validation * Add bullet-point draft for next version
1 parent d30d118 commit add4421

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 0.8.6 (draft)
4+
5+
This is a minor release that fixes a validation issue that caused the integration to stop working for users with at least one charger they only have the User role for.
6+
7+
In addition, it also fixes an issue where calls to the localSettings-API triggered an error on validating the response.
8+
39
## 0.8.5
410

511
This is a minor release that fixes a bug in the setting of the Min/Max current of a charger.

custom_components/zaptec/zaptec/validate.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class Installation(BaseModel):
1717
model_config = ConfigDict(extra="allow")
1818
Id: str
1919
Active: bool
20-
AuthenticationType: int
2120
CurrentUserRoles: int
2221
InstallationType: int
2322
NetworkType: int
@@ -88,20 +87,6 @@ class ChargerFirmware(BaseModel):
8887
IsUpToDate: bool
8988

9089

91-
class ChargerLocalSettings(BaseModel):
92-
"""
93-
Pydantic model for the local settings of a Zaptec charger.
94-
95-
Note: This model is used in an undocumented API-call, and should be removed as soon as we have
96-
official API-calls that can cover the necessary functionality
97-
"""
98-
99-
model_config = ConfigDict(extra="allow")
100-
Id: str
101-
Name: str | None = None
102-
DeviceId: str | None = None
103-
104-
10590
class InstallationConnectionDetails(BaseModel):
10691
"""Pydantic model for the servicebus connection details of a Zaptec installation."""
10792

@@ -136,7 +121,7 @@ class InstallationConnectionDetails(BaseModel):
136121
r"chargers/[0-9a-f\-]+/state": CHARGER_STATES,
137122
r"chargers/[0-9a-f\-]+/authorizecharge": None,
138123
r"chargers/[0-9a-f\-]+/SendCommand/[0-9]+": None,
139-
r"chargers/[0-9a-f\-]+/localSettings": ChargerLocalSettings,
124+
r"chargers/[0-9a-f\-]+/localSettings": None,
140125
r"chargers/[0-9a-f\-]+/update": None,
141126
r"chargerFirmware/installation/[0-9a-f\-]+": CHARGER_FIRMWARES,
142127
}

0 commit comments

Comments
 (0)