♻️ refactor + location conditions

This commit is contained in:
JMARyA 2025-04-16 04:05:29 +02:00
parent ce9cdc4256
commit 3076ebe6a0
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
19 changed files with 1228 additions and 520 deletions

View file

@ -75,3 +75,15 @@ variants:
name: "Regular Water"
barcodes: [12345678]
```
### Need Conditions
Some items prefer or need to be stored under some conditions. These conditions can be configured and warn you when locations dont match the required conditions.
```yml
name: "Water"
variants:
regular:
name: "Regular Water"
needs:
temperature: [5.0, 10.0]
```

View file

@ -50,7 +50,20 @@ Example: Freezer
{
"name": "Freezer",
"conditions": {
"temperature": -10
"temperature": -10.0
}
}
```
#### Fetch temperature from Home Assistant
You can fetch the temperature from a sensor via Home Assistant.
You need to setup a API Token for Home Assistant. After that you can enter the sensors API route in the location definition:
```json
{
"name": "Freezer",
"conditions": {
"temperature_sensor": "https://homeassistant.local/api/states/sensor.freezer_temperature"
}
}
```