mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-03-01 20:23:42 +00:00
move everything to linux folder
This commit is contained in:
26
linux/aln/Notifications/EarDetection.py
Normal file
26
linux/aln/Notifications/EarDetection.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from ..Capabilites import Capabilites
|
||||
from ..enums import enums
|
||||
from typing import Literal
|
||||
|
||||
class EarDetectionNotification:
|
||||
NOTIFICATION_BIT = Capabilites.EAR_DETECTION
|
||||
NOTIFICATION_PREFIX = enums.PREFIX + NOTIFICATION_BIT
|
||||
IN_EAR = 0x00
|
||||
OUT_OF_EAR = 0x01
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def isEarDetectionData(self, data: bytes):
|
||||
if len(data) != 8:
|
||||
return False
|
||||
if data.hex().startswith(self.NOTIFICATION_PREFIX.hex()):
|
||||
return True
|
||||
|
||||
def setEarDetection(self, data: bytes):
|
||||
self.first = data[6]
|
||||
self.second = data[7]
|
||||
|
||||
def getEarDetection(self):
|
||||
return [self.first, self.second]
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user