refactor: Abstract DumbCaneSoil to generic SoilMoisture component
This commit is contained in:
parent
4202e1a19d
commit
24bada26a4
|
@ -1221,12 +1221,12 @@ function BedroomLux({end, duration}) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function DumbCaneSoil({end, duration}) {
|
function SoilMoisture({name, sensorName, sensorId, end, duration}) {
|
||||||
const [data, loading, tickFormatter] = useSensor('soil', 'Dumb Cane', end, duration);
|
const [data, loading, tickFormatter] = useSensor(sensorId, sensorName, end, duration);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ChartContainer
|
<ChartContainer
|
||||||
name='Dumb Cane Soil Moisture'
|
name={name}
|
||||||
data={data}
|
data={data}
|
||||||
lastFormatter={(x) => x.soil?.toFixed(1)}
|
lastFormatter={(x) => x.soil?.toFixed(1)}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
|
@ -1295,7 +1295,7 @@ function Graphs({end, duration}) {
|
||||||
<LivingRoomLux end={end} duration={duration} />
|
<LivingRoomLux end={end} duration={duration} />
|
||||||
<KitchenLux end={end} duration={duration} />
|
<KitchenLux end={end} duration={duration} />
|
||||||
<BedroomLux end={end} duration={duration} />
|
<BedroomLux end={end} duration={duration} />
|
||||||
<DumbCaneSoil end={end} duration={duration} />
|
<SoilMoisture name="Dumb Cane Soil Moisture" sensorName="Dumb Cane" sensorId="soil1" end={end} duration={duration} />
|
||||||
|
|
||||||
{!!api_key ||
|
{!!api_key ||
|
||||||
<div>
|
<div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user