-
-
Notifications
You must be signed in to change notification settings - Fork 585
many bug in python-miio(list will be update) #2027
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
Comments
[tool.poetry.group.dev.dependencies]
pytest = ">=6.2.5"
pytest-cov = "*"
pytest-mock = "*"
pytest-asyncio = "*"
pre-commit = "*"
doc8 = "*"
restructuredtext_lint = "*"
tox = "*"
isort = "*"
cffi = "*"
docformatter = "*"
mypy = {version = "*", markers = "platform_python_implementation == 'CPython'"}
coverage = {extras = ["toml"], version = "*"}
python yeni sürümlerde desteklemeyeceğini söyledi. |
# partial is required here for str2bool, see https://stackoverflow.com/a/40339397
class MiotValueType(Enum):
def _str2bool(x):
"""Helper to convert string to boolean."""
return x.lower() in ("true", "1")
Int = int
Float = float
Bool = member(partial(_str2bool))
Str = str
def cast_miot_value(value_str: str, value_type_name: str):
"""
Bir dize değeri (string) belirtilen MiotValueType'a dönüştürür (cast eder).
"""
try:
miot_type_member = MiotValueType[value_type_name]
casting_func = miot_type_member.value
return casting_func(value_str)
except KeyError:
raise ValueError(f"Geçersiz MiotValueType adı: {value_type_name}")
except (ValueError, TypeError) as e:
raise TypeError(f"'{value_str}' değerini '{value_type_name}' tipine dönüştürülemiyor: {e}") bunu da ekleyebilirsin. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
click_common.py
içindeki satırı bu şekilde değiştirince"The following issue was resolved by changing
default_output=default_output
todefault_output=format_output
: Command.init() got an unexpected keyword argument 'default_output'."The text was updated successfully, but these errors were encountered: