mirror of
https://github.com/onyx-and-iris/xair-api-python.git
synced 2026-04-18 05:23:32 +00:00
tomli/tomllib compatibility layer added.
Type annotation Self removed. python version requirement changed. tomli added as runtime dependency if py ver < 3.11 minor version bump.
This commit is contained in:
@@ -17,7 +17,7 @@ class X32KindMap:
|
||||
@dataclass
|
||||
class KindMap:
|
||||
def __str__(self) -> str:
|
||||
return self.id_.capitalize()
|
||||
return self.id_
|
||||
|
||||
|
||||
@dataclass
|
||||
|
||||
@@ -2,9 +2,13 @@ import abc
|
||||
import threading
|
||||
import time
|
||||
from pathlib import Path
|
||||
from typing import Optional, Self
|
||||
from typing import Optional
|
||||
|
||||
try:
|
||||
import tomllib
|
||||
except ModuleNotFoundError:
|
||||
import tomli as tomllib
|
||||
|
||||
import tomllib
|
||||
from pythonosc.dispatcher import Dispatcher
|
||||
from pythonosc.osc_message_builder import OscMessageBuilder
|
||||
from pythonosc.osc_server import BlockingOSCUDPServer
|
||||
@@ -60,7 +64,7 @@ class XAirRemote(abc.ABC):
|
||||
raise XAirRemoteError("No valid ip or password detected")
|
||||
self.server = OSCClientServer((self.xair_ip, self.xair_port), dispatcher)
|
||||
|
||||
def __enter__(self) -> Self:
|
||||
def __enter__(self):
|
||||
self.worker = threading.Thread(target=self.run_server, daemon=True)
|
||||
self.worker.start()
|
||||
self.validate_connection()
|
||||
|
||||
Reference in New Issue
Block a user