-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds: Infrared devices query to use in homeassistant
- Loading branch information
Jhonattan Souza
authored and
Jhonattan Souza
committed
Aug 27, 2021
1 parent
1743776
commit dba5f79
Showing
3 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
from types import SimpleNamespace | ||
|
||
|
||
class TuyaRemoteDeviceKey(SimpleNamespace): | ||
key: str | ||
key_id: int | ||
key_name: str | ||
standard_key: bool | ||
|
||
def __init__(self, key: str, key_id: int, key_name: str, standard_key: bool): | ||
self.key = key | ||
self.key_id = key_id | ||
self.key_name = key_name | ||
self.standard_key = standard_key | ||
|
||
|
||
class TuyaRemoteDevice(SimpleNamespace): | ||
remote_name = str | ||
category_id = str | ||
brand_id = str | ||
remote_index = str | ||
remote_id = str | ||
keys: list | ||
|
||
def __init__(self, props: dict, keys: list): | ||
self.map(props) | ||
self.keys = keys | ||
|
||
def map(self, props: dict): | ||
self.remote_name = props["remote_name"] | ||
self.category_id = props["category_id"] | ||
self.brand_id = props["brand_id"] | ||
self.remote_index = props["remote_index"] | ||
self.remote_id = props["remote_id"] | ||
|
||
|
||
class TuyaRemote(SimpleNamespace): | ||
remote_id: str | ||
remote_devices = list | ||
|
||
def __init__(self, remote_id: str, remote_devices: list): | ||
self.remote_id = remote_id | ||
self.remote_devices = remote_devices | ||
|
||
|
||
|