Add get_holiday.
This commit is contained in:
parent
e66627bf8a
commit
cf195e83ed
12
neohub.py
12
neohub.py
|
@ -131,7 +131,7 @@ class NeoHub:
|
||||||
Format is specified using ScheduleFormat enum:
|
Format is specified using ScheduleFormat enum:
|
||||||
"""
|
"""
|
||||||
|
|
||||||
message = {"SET_FORMAT": format: ScheduleFormat}
|
message = {"SET_FORMAT": format}
|
||||||
reply = {"result": "Format was set"}
|
reply = {"result": "Format was set"}
|
||||||
|
|
||||||
result = await self._send(message, reply)
|
result = await self._send(message, reply)
|
||||||
|
@ -151,3 +151,13 @@ class NeoHub:
|
||||||
|
|
||||||
result = await self._send(message, reply)
|
result = await self._send(message, reply)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
async def get_holiday(self):
|
||||||
|
"""
|
||||||
|
Get list of holidays
|
||||||
|
"""
|
||||||
|
message = {"GET_HOLIDAY": 0}
|
||||||
|
|
||||||
|
result = await self._send(message)
|
||||||
|
return result
|
||||||
|
|
2
test.py
2
test.py
|
@ -15,7 +15,7 @@ async def run():
|
||||||
await hub.connect()
|
await hub.connect()
|
||||||
system = await hub.get_system()
|
system = await hub.get_system()
|
||||||
print(vars(system))
|
print(vars(system))
|
||||||
result = await hub.set_format(ScheduleFormat.ZERO)
|
result = await hub.get_holiday()
|
||||||
print(result)
|
print(result)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue