mirror of
https://github.com/onyx-and-iris/xair-api-python.git
synced 2026-04-18 13:33:31 +00:00
remove type checks, prefer duck typing.
keep bounds checks for any vals passed to lin_set/log_set
This commit is contained in:
@@ -9,8 +9,6 @@ def bool_prop(param):
|
||||
return self.getter(param)[0] == 1
|
||||
|
||||
def fset(self, val):
|
||||
if not isinstance(val, bool):
|
||||
raise XAirRemoteError(f"{param} is a boolean parameter")
|
||||
self.setter(param, 1 if val else 0)
|
||||
|
||||
return property(fget, fset)
|
||||
@@ -23,8 +21,6 @@ def string_prop(param):
|
||||
return self.getter(param)[0]
|
||||
|
||||
def fset(self, val):
|
||||
if not isinstance(val, str):
|
||||
raise XAirRemoteError(f"{param} is a string parameter")
|
||||
self.setter(param, val)
|
||||
|
||||
return property(fget, fset)
|
||||
@@ -37,8 +33,6 @@ def int_prop(param):
|
||||
return int(self.getter(param)[0])
|
||||
|
||||
def fset(self, val):
|
||||
if not isinstance(val, int):
|
||||
raise XAirRemoteError(f"{param} is an integer parameter")
|
||||
self.setter(param, val)
|
||||
|
||||
return property(fget, fset)
|
||||
@@ -51,8 +45,6 @@ def float_prop(param):
|
||||
return round(self.getter(param)[0], 1)
|
||||
|
||||
def fset(self, val):
|
||||
if not isinstance(val, int):
|
||||
raise XAirRemoteError(f"{param} is a float parameter")
|
||||
self.setter(param, val)
|
||||
|
||||
return property(fget, fset)
|
||||
|
||||
Reference in New Issue
Block a user