Skip to content

Python distutils deprecated starting python3.12 and higher #34

Description

@jaschuet

Hello,

did an update of my debian box and want to run pyess again to collect all the ESS data. Unfortunately pyess is using python-distutils which is deprecated since python3.12. This causing the service to crash directly after start.

Replace in pyess/essmqtt.py

from distutils.util import strtobool

with

from argparse import ArgumentTypeError

def strtobool(val):
    val = val.lower()
    if val in ("y", "yes", "t", "true", "on", "1"):
        return True
    if val in ("n", "no", "f", "false", "off", "0"):
        return False
    raise ArgumentTypeError("Boolean value  #expected.")

At least this is working for me and is compatible

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions