Quickstart#
Create the connection to Fermax Blue servers (without notification setup):
from bluecon import BlueConAPI, INotification
def notification_callback(notification: INotification):
print(notification.getNotificationType())
username = "[email protected]"
password = "1234"
clientId = "clientId"
clientSecret = "clientSecret"
blueConAPIClient = await BlueConAPI.create(
username,
password,
clientId,
clientSecret,
None,
None,
None,
None,
None,
notification_callback
)
Get user details:
userInfo = await blueConAPIClient.getUserInfo()
Get pairings for user:
pairings = await blueConAPIClient.getPairings()
Open door:
firstDoor = pairings[0]
openDoorResult = await blueConAPIClient.openDoor(firstDoor.deviceId, firstDoor.accessDoorMap['ZERO'])
Get device info:
blueConAPIClient.getDeviceInfo(firstDoor.deviceId)
Receiving ringing notifications#
Create the connection to Fermax Blue servers and FCM:
from bluecon import BlueConAPI, INotification
def notification_callback(notification: INotification):
print(notification.getNotificationType())
username = "[email protected]"
password = "1234"
clientId = "clientId"
clientSecret = "clientSecret"
senderId = 0
apiKey = "apiKey"
projectId = "projectId"
appId = "appId"
packageName = "packageName"
blueConAPIClient = await BlueConAPI.create(
username,
password,
clientId,
clientSecret,
senderId,
apiKey,
projectId,
appId,
packageName,
notification_callback
)
Listen to notifications:
blueConAPIClient.startNotificationListener()
Stop listening to notifications:
blueConAPIClient.stopNotificationListener()
Get last captured picture:
blueConAPIClient.getLastPicture(firstDoor.deviceId)