79 lines
1.8 KiB
Bash
Executable File
79 lines
1.8 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
wohnzimmer='Wohnzimmer'
|
|
greta='Greta'
|
|
charlotte='Charlotte'
|
|
schlafzimmer='Schlafzimmer'
|
|
|
|
|
|
if [ $1 = $wohnzimmer ]
|
|
then
|
|
curl --request PUT \
|
|
--url https://developer-api.govee.com/v1/appliance/devices/control \
|
|
--header 'Govee-API-Key: aaecbef1-57f8-44e6-9ded-f05cbc840c10' \
|
|
--header 'accept: application/json' \
|
|
--header 'content-type: application/json' \
|
|
--data '
|
|
{
|
|
"device": "18:3C:D4:AD:FC:85:FC:1A",
|
|
"model": "H7140",
|
|
"cmd": {
|
|
"name": "turn",
|
|
"value": "off"
|
|
}
|
|
}
|
|
'
|
|
elif [ $1 = $schlafzimmer ]
|
|
then
|
|
curl --request PUT \
|
|
--url https://developer-api.govee.com/v1/appliance/devices/control \
|
|
--header 'Govee-API-Key: aaecbef1-57f8-44e6-9ded-f05cbc840c10' \
|
|
--header 'accept: application/json' \
|
|
--header 'content-type: application/json' \
|
|
--data '
|
|
{
|
|
"device": "2E:95:D4:AD:FC:86:9E:7F",
|
|
"model": "H7140",
|
|
"cmd": {
|
|
"name": "turn",
|
|
"value": "off"
|
|
}
|
|
}
|
|
'
|
|
elif [ $1 = $greta ]
|
|
then
|
|
curl --request PUT \
|
|
--url https://developer-api.govee.com/v1/appliance/devices/control \
|
|
--header 'Govee-API-Key: aaecbef1-57f8-44e6-9ded-f05cbc840c10' \
|
|
--header 'accept: application/json' \
|
|
--header 'content-type: application/json' \
|
|
--data '
|
|
{
|
|
"device": "2C:3C:D4:AD:FC:85:ED:84",
|
|
"model": "H7140",
|
|
"cmd": {
|
|
"name": "turn",
|
|
"value": "off"
|
|
}
|
|
}
|
|
'
|
|
elif [ $1 = $charlotte ]
|
|
then
|
|
curl --request PUT \
|
|
--url https://developer-api.govee.com/v1/appliance/devices/control \
|
|
--header 'Govee-API-Key: aaecbef1-57f8-44e6-9ded-f05cbc840c10' \
|
|
--header 'accept: application/json' \
|
|
--header 'content-type: application/json' \
|
|
--data '
|
|
{
|
|
"device": "2E:98:D4:AD:FC:85:C8:C1",
|
|
"model": "H7140",
|
|
"cmd": {
|
|
"name": "turn",
|
|
"value": "off"
|
|
}
|
|
}
|
|
'
|
|
|
|
fi
|