Total Complexity | 0 |
Total Lines | 20 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | '''test telegram api''' |
||
2 | from backend.fcmapp import ApplicationService, ComponentName |
||
3 | |||
4 | APP = ApplicationService(ComponentName.fullcycle) |
||
5 | |||
6 | MESSAGE = 'Full Cycle Mining test {}'.format(APP.now()) |
||
7 | if APP.configuration.is_enabled('telegram'): |
||
8 | APP.telegram.sendmessage(MESSAGE) |
||
9 | else: |
||
10 | print('telegram is not enabled in configuration') |
||
11 | |||
12 | if APP.configuration.is_enabled('camera'): |
||
13 | FILEOUT = APP.camera.take_picture('fullcycle_camera.png') |
||
14 | APP.telegram.sendphoto(FILEOUT) |
||
15 | else: |
||
16 | print('camera is not enabled in configuration') |
||
17 | |||
18 | |||
19 | APP.shutdown() |
||
20 |