-
Notifications
You must be signed in to change notification settings - Fork 0
/
domoPadDevices.py
77 lines (63 loc) · 4.07 KB
/
domoPadDevices.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# /////////////////////////////////////////////////////////////////////////////////////////
# /////////////////////////////////////////////////////////////////////////////////////////
# Domotics Pad Client Plugin by RogueProeliator <adam@duncanwaredevelopment.com>
# /////////////////////////////////////////////////////////////////////////////////////////
# /////////////////////////////////////////////////////////////////////////////////////////
# /////////////////////////////////////////////////////////////////////////////////////////
# Python imports
# /////////////////////////////////////////////////////////////////////////////////////////
import RPFramework
# /////////////////////////////////////////////////////////////////////////////////////////
# /////////////////////////////////////////////////////////////////////////////////////////
# DomoPadAndroidClient
# /////////////////////////////////////////////////////////////////////////////////////////
# /////////////////////////////////////////////////////////////////////////////////////////
class DomoPadAndroidClient(RPFramework.RPFrameworkNonCommChildDevice):
# /////////////////////////////////////////////////////////////////////////////////////
# Class construction and destruction methods
# /////////////////////////////////////////////////////////////////////////////////////
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Constructor called once upon plugin class receiving a command to start device
# communication. The plugin will call other commands when needed, simply zero out the
# member variables
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
def __init__(self, plugin, device):
super().__init__(plugin, device)
self.upgradedDeviceProperties.append(("SupportsBatteryLevel", True))
self.upgradedDeviceStates.append("modelName")
self.upgradedDeviceStates.append("batteryStatus")
self.upgradedDeviceStates.append("batteryLevel")
self.upgradedDeviceStates.append("longitude")
self.upgradedDeviceStates.append("latitude")
self.upgradedDeviceStates.append("locationFixTime")
# /////////////////////////////////////////////////////////////////////////////////////
# Overridden communications functions
# /////////////////////////////////////////////////////////////////////////////////////
def initiateCommunications(self):
super(DomoPadAndroidClient, self).initiateCommunications()
# update the state of the device to reflect the pairing status...
current_pairing_prop = self.indigoDevice.pluginProps.get("deviceRegistrationId", "")
if current_pairing_prop == "":
self.indigoDevice.updateStateOnServer("isPaired", False, uiValue="Not Paired")
else:
self.indigoDevice.updateStateOnServer("isPaired", True, uiValue="Paired")
# /////////////////////////////////////////////////////////////////////////////////////////
# /////////////////////////////////////////////////////////////////////////////////////////
# VideoCameraFeed
# Handles the specification of a video feed that can be shown within HousePad, such as
# to show live security camera feeds
# /////////////////////////////////////////////////////////////////////////////////////////
# /////////////////////////////////////////////////////////////////////////////////////////
class VideoCameraFeed(RPFramework.RPFrameworkNonCommChildDevice):
# /////////////////////////////////////////////////////////////////////////////////////
# Class construction and destruction methods
# /////////////////////////////////////////////////////////////////////////////////////
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Constructor called once upon plugin class receiving a command to start device
# communication. The plugin will call other commands when needed, simply zero out the
# member variables
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
def __init__(self, plugin, device):
super(VideoCameraFeed, self).__init__(plugin, device)