mirror of
https://github.com/home-assistant/android
synced 2024-09-18 23:52:51 +00:00
Fix light sensor control (#1065)
This commit is contained in:
parent
366b02ed15
commit
16625e9614
|
@ -44,7 +44,7 @@ class LightControl {
|
|||
RangeTemplate(
|
||||
entity.entityId,
|
||||
0f,
|
||||
255f,
|
||||
100f,
|
||||
(entity.attributes["brightness"] as? Number)
|
||||
?.toFloat()
|
||||
?.div(255f)
|
||||
|
@ -74,12 +74,13 @@ class LightControl {
|
|||
true
|
||||
}
|
||||
is FloatAction -> {
|
||||
val convertBrightness = action.newValue.div(100).times(255)
|
||||
integrationRepository.callService(
|
||||
action.templateId.split(".")[0],
|
||||
"turn_on",
|
||||
hashMapOf(
|
||||
"entity_id" to action.templateId,
|
||||
"brightness" to action.newValue.toInt()
|
||||
"brightness" to convertBrightness.toInt()
|
||||
)
|
||||
)
|
||||
true
|
||||
|
|
Loading…
Reference in a new issue