-
Notifications
You must be signed in to change notification settings - Fork 0
/
duinocoin.yaml
38 lines (35 loc) · 1.37 KB
/
duinocoin.yaml
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
### Show balance, verification status, number of warnings ###
sensor:
- platform: python_script
name: DUCO balance
scan_interval: '00:10:00'
unit_of_measurement: DUCO
icon: mdi:currency-btc
source: |
import requests
response = requests.get('https://server.duinocoin.com/balances/<username>')
response.raise_for_status()
data = response.json()
balance= str(round(data['result']['balance'], 2))
self.state = balance
- platform: python_script
name: DUCO is verified
scan_interval: '00:30:00'
source: |
import requests
response = requests.get('https://server.duinocoin.com/balances/<username>')
response.raise_for_status()
data = response.json()
is_verified = str((data['result']['verified']))
self.state = is_verified
- platform: python_script
name: DUCO warnings
scan_interval: '00:15:05'
icon: mdi:weather-cloudy-alert
source: |
import requests
response = requests.get('https://server.duinocoin.com/balances/<username>')
response.raise_for_status()
data = response.json()
warnings = str((data['result']['warnings']))
self.state = warnings