Skip to content

Commit b2aa11d

Browse files
Copilotfrenck
andcommitted
Fix TypeError in number increment/decrement services when entity.value is string
Co-authored-by: frenck <[email protected]>
1 parent 09ecbcb commit b2aa11d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

custom_components/spook/ectoplasms/number/services/decrement.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async def async_handle_service(
3636
)
3737
raise ValueError(msg)
3838

39-
value = entity.value - amount
39+
value = float(entity.value) - amount
4040

4141
if entity.min_value is not None:
4242
value = max(value, entity.min_value)

custom_components/spook/ectoplasms/number/services/increment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async def async_handle_service(
3636
)
3737
raise ValueError(msg)
3838

39-
value = entity.value + amount
39+
value = float(entity.value) + amount
4040

4141
if entity.max_value is not None:
4242
value = min(value, entity.max_value)

0 commit comments

Comments
 (0)