Skip to content

Commit

Permalink
add CommonPointerMixin class to common
Browse files Browse the repository at this point in the history
  • Loading branch information
brainelectronics committed Jul 29, 2022
1 parent 1ed28f1 commit 00a7f85
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions nextion/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,37 @@ def setFont(self, number: int) -> bool:
return self._nh.recvRetCommandFinished()


class CommonPointerMixin(object):
"""docstring for CommonPointerMixin"""
def Get_pointer_thickness_wid(self) -> int:
"""
Get pointer wid attribute of component
:returns: The pointer thickness
:rtype: int
"""
cmd = "get {}.wid".format(self.name)
self._nh.sendCommand(cmd)
sleep(0.1) # necessary, data might not be available otherwise
return self._nh.recvRetNumber()

def Set_pointer_thickness_wid(self, number: int) -> bool:
"""
Set pointer hig attribute of component
:param number: The pointer thickness
:type number: int
:returns: True on success, false otherwise
:rtype: bool
"""
cmd = "{}.wid={}".format(self.name, number)
self._nh.sendCommand(cmd)
cmd = "ref {}".format(self.name)
self._nh.sendCommand(cmd)
return self._nh.recvRetCommandFinished()


class CommonPositionMixin(object):
"""docstring for CommonPositionMixin"""
def Get_place_xcen(self) -> int:
Expand Down

0 comments on commit 00a7f85

Please sign in to comment.