Skip to content

Commit

Permalink
Replace deprecated methods
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Ott <[email protected]>
  • Loading branch information
DerOetzi committed May 19, 2024
1 parent 408d1ec commit 9d2e616
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
14 changes: 12 additions & 2 deletions core/.pylintrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
[MASTER]
extension-pkg-whitelist=pydantic
[main]
load-plugins=pylint.extensions.docparams
accept-no-param-doc=false

[messages control]
disable=C0114,C0115,C0116,W9011,W9015

[Parameter_documentation]
accept-no-return-doc=no

[TYPECHECK]
ignored-classes=pydantic.fields.FieldInfo
2 changes: 1 addition & 1 deletion core/learninghouse/models/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def load_config(cls) -> Sensors:
else:
logger.warning("No sensors.json found")

return Sensors.parse_obj(sensors)
return Sensors(sensors)

def write_config(self) -> None:
filename = service_settings().brains_directory / "sensors.json"
Expand Down
4 changes: 2 additions & 2 deletions core/learninghouse/services/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ def verify_jwt(
payload_args = settings.jwt_payload_claims

try:
payload = TokenPayload.parse_obj(
jwt.decode(
payload = TokenPayload(
**jwt.decode(
access_token,
settings.jwt_secret,
algorithms=["HS256"],
Expand Down
2 changes: 1 addition & 1 deletion core/learninghouse/services/brain.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def list_all(cls) -> BrainInfos:
except BrainNoConfiguration:
pass

return BrainInfos.parse_obj(brains)
return BrainInfos(**brains)

@staticmethod
def get_info(name: str) -> BrainInfo:
Expand Down

0 comments on commit 9d2e616

Please sign in to comment.