diff --git a/app/src/main/java/li/klass/fhem/adapter/devices/genericui/ToggleDeviceActionRow.kt b/app/src/main/java/li/klass/fhem/adapter/devices/genericui/ToggleDeviceActionRow.kt index 452868177..d17c711a6 100644 --- a/app/src/main/java/li/klass/fhem/adapter/devices/genericui/ToggleDeviceActionRow.kt +++ b/app/src/main/java/li/klass/fhem/adapter/devices/genericui/ToggleDeviceActionRow.kt @@ -35,7 +35,7 @@ import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.launch import kotlinx.coroutines.withContext import li.klass.fhem.R -import li.klass.fhem.adapter.devices.toggle.OnOffBehavior +import li.klass.fhem.behavior.toggle.OnOffBehavior import li.klass.fhem.constants.Actions import li.klass.fhem.devices.backend.ToggleableService import li.klass.fhem.domain.EventMap diff --git a/app/src/main/java/li/klass/fhem/adapter/devices/genericui/onoff/OnOffActionRowForToggleables.kt b/app/src/main/java/li/klass/fhem/adapter/devices/genericui/onoff/OnOffActionRowForToggleables.kt index fadc97223..e1e3d1783 100644 --- a/app/src/main/java/li/klass/fhem/adapter/devices/genericui/onoff/OnOffActionRowForToggleables.kt +++ b/app/src/main/java/li/klass/fhem/adapter/devices/genericui/onoff/OnOffActionRowForToggleables.kt @@ -29,8 +29,8 @@ import android.view.View import android.widget.TableRow import li.klass.fhem.adapter.devices.hook.ButtonHook import li.klass.fhem.adapter.devices.hook.DeviceHookProvider -import li.klass.fhem.adapter.devices.toggle.OnOffBehavior import li.klass.fhem.adapter.uiservice.StateUiService +import li.klass.fhem.behavior.toggle.OnOffBehavior import li.klass.fhem.domain.core.FhemDevice class OnOffActionRowForToggleables(layoutId: Int, diff --git a/app/src/main/java/li/klass/fhem/adapter/devices/strategy/ToggleableStrategy.kt b/app/src/main/java/li/klass/fhem/adapter/devices/strategy/ToggleableStrategy.kt index 197c4f42a..1abfcf4a5 100644 --- a/app/src/main/java/li/klass/fhem/adapter/devices/strategy/ToggleableStrategy.kt +++ b/app/src/main/java/li/klass/fhem/adapter/devices/strategy/ToggleableStrategy.kt @@ -36,8 +36,8 @@ import li.klass.fhem.adapter.devices.genericui.onoff.AbstractOnOffActionRow import li.klass.fhem.adapter.devices.genericui.onoff.OnOffActionRowForToggleables import li.klass.fhem.adapter.devices.hook.ButtonHook.* import li.klass.fhem.adapter.devices.hook.DeviceHookProvider -import li.klass.fhem.adapter.devices.toggle.OnOffBehavior import li.klass.fhem.adapter.uiservice.StateUiService +import li.klass.fhem.behavior.toggle.OnOffBehavior import li.klass.fhem.devices.backend.ToggleableService import li.klass.fhem.domain.core.FhemDevice import org.apache.commons.lang3.time.StopWatch diff --git a/app/src/main/java/li/klass/fhem/appwidget/ui/widget/medium/OnOffWidgetView.kt b/app/src/main/java/li/klass/fhem/appwidget/ui/widget/medium/OnOffWidgetView.kt index 7827df43e..879f034c5 100644 --- a/app/src/main/java/li/klass/fhem/appwidget/ui/widget/medium/OnOffWidgetView.kt +++ b/app/src/main/java/li/klass/fhem/appwidget/ui/widget/medium/OnOffWidgetView.kt @@ -32,20 +32,20 @@ import android.widget.RemoteViews import androidx.core.content.ContextCompat import li.klass.fhem.R import li.klass.fhem.adapter.devices.hook.DeviceHookProvider -import li.klass.fhem.adapter.devices.toggle.OnOffBehavior import li.klass.fhem.appwidget.action.AppWidgetActionBroadcastReceiver import li.klass.fhem.appwidget.ui.widget.WidgetSize import li.klass.fhem.appwidget.ui.widget.WidgetType import li.klass.fhem.appwidget.ui.widget.base.DeviceAppWidgetView import li.klass.fhem.appwidget.update.WidgetConfiguration +import li.klass.fhem.behavior.toggle.OnOffBehavior import li.klass.fhem.constants.Actions import li.klass.fhem.constants.BundleExtraKeys import li.klass.fhem.domain.core.FhemDevice import javax.inject.Inject class OnOffWidgetView @Inject constructor( - val onOffBehavior: OnOffBehavior, - val deviceHookProvider: DeviceHookProvider + val onOffBehavior: OnOffBehavior, + val deviceHookProvider: DeviceHookProvider ) : DeviceAppWidgetView() { override fun getWidgetName(): Int = R.string.widget_onOff diff --git a/app/src/main/java/li/klass/fhem/appwidget/ui/widget/medium/ToggleWidgetView.kt b/app/src/main/java/li/klass/fhem/appwidget/ui/widget/medium/ToggleWidgetView.kt index dd927c4f0..c6d8c57b8 100644 --- a/app/src/main/java/li/klass/fhem/appwidget/ui/widget/medium/ToggleWidgetView.kt +++ b/app/src/main/java/li/klass/fhem/appwidget/ui/widget/medium/ToggleWidgetView.kt @@ -32,12 +32,12 @@ import android.widget.RemoteViews import li.klass.fhem.R import li.klass.fhem.adapter.devices.hook.ButtonHook import li.klass.fhem.adapter.devices.hook.DeviceHookProvider -import li.klass.fhem.adapter.devices.toggle.OnOffBehavior import li.klass.fhem.appwidget.action.AppWidgetActionBroadcastReceiver import li.klass.fhem.appwidget.ui.widget.WidgetSize import li.klass.fhem.appwidget.ui.widget.WidgetType import li.klass.fhem.appwidget.ui.widget.base.DeviceAppWidgetView import li.klass.fhem.appwidget.update.WidgetConfiguration +import li.klass.fhem.behavior.toggle.OnOffBehavior import li.klass.fhem.constants.Actions import li.klass.fhem.constants.BundleExtraKeys.* import li.klass.fhem.domain.core.FhemDevice diff --git a/app/src/main/java/li/klass/fhem/appwidget/ui/widget/small/SmallToggleWidget.kt b/app/src/main/java/li/klass/fhem/appwidget/ui/widget/small/SmallToggleWidget.kt index 7f03d62e0..3e2a3ef2a 100644 --- a/app/src/main/java/li/klass/fhem/appwidget/ui/widget/small/SmallToggleWidget.kt +++ b/app/src/main/java/li/klass/fhem/appwidget/ui/widget/small/SmallToggleWidget.kt @@ -26,14 +26,13 @@ package li.klass.fhem.appwidget.ui.widget.small import android.content.Context import android.widget.RemoteViews - import li.klass.fhem.R import li.klass.fhem.adapter.devices.hook.DeviceHookProvider -import li.klass.fhem.adapter.devices.toggle.OnOffBehavior import li.klass.fhem.appwidget.ui.widget.WidgetSize import li.klass.fhem.appwidget.ui.widget.WidgetType import li.klass.fhem.appwidget.ui.widget.medium.ToggleWidgetView import li.klass.fhem.appwidget.update.WidgetConfiguration +import li.klass.fhem.behavior.toggle.OnOffBehavior import li.klass.fhem.domain.core.FhemDevice import javax.inject.Inject diff --git a/app/src/main/java/li/klass/fhem/adapter/devices/toggle/OnOffBehavior.kt b/app/src/main/java/li/klass/fhem/behavior/toggle/OnOffBehavior.kt similarity index 99% rename from app/src/main/java/li/klass/fhem/adapter/devices/toggle/OnOffBehavior.kt rename to app/src/main/java/li/klass/fhem/behavior/toggle/OnOffBehavior.kt index 5ccac1f9c..ddeea8528 100644 --- a/app/src/main/java/li/klass/fhem/adapter/devices/toggle/OnOffBehavior.kt +++ b/app/src/main/java/li/klass/fhem/behavior/toggle/OnOffBehavior.kt @@ -22,7 +22,7 @@ * Boston, MA 02110-1301 USA */ -package li.klass.fhem.adapter.devices.toggle +package li.klass.fhem.behavior.toggle import li.klass.fhem.adapter.devices.hook.ButtonHook import li.klass.fhem.adapter.devices.hook.DeviceHookProvider diff --git a/app/src/main/java/li/klass/fhem/dagger/ApplicationComponent.java b/app/src/main/java/li/klass/fhem/dagger/ApplicationComponent.java index 8988915cf..1fff7d69e 100644 --- a/app/src/main/java/li/klass/fhem/dagger/ApplicationComponent.java +++ b/app/src/main/java/li/klass/fhem/dagger/ApplicationComponent.java @@ -42,7 +42,6 @@ import li.klass.fhem.activities.locale.SendCommandLocaleSettingActivity; import li.klass.fhem.adapter.devices.core.GenericOverviewDetailDeviceAdapter; import li.klass.fhem.adapter.devices.strategy.ToggleableStrategy; -import li.klass.fhem.adapter.devices.toggle.OnOffBehavior; import li.klass.fhem.alarm.clock.update.AlarmClockIntentService; import li.klass.fhem.appindex.AppIndexIntentService; import li.klass.fhem.appwidget.action.AppWidgetActionBroadcastReceiver; @@ -74,6 +73,7 @@ import li.klass.fhem.appwidget.ui.widget.small.TimersLinkWidget; import li.klass.fhem.appwidget.update.AppWidgetListViewUpdateRemoteViewsService; import li.klass.fhem.backup.ImportExportService; +import li.klass.fhem.behavior.toggle.OnOffBehavior; import li.klass.fhem.device.control.AndroidControlsProviderService; import li.klass.fhem.fcm.receiver.FcmIntentService; import li.klass.fhem.graph.backend.gplot.GPlotHolder; diff --git a/app/src/main/java/li/klass/fhem/device/control/AndroidControlsProviderService.kt b/app/src/main/java/li/klass/fhem/device/control/AndroidControlsProviderService.kt index 7e52ea5f4..7a3963696 100644 --- a/app/src/main/java/li/klass/fhem/device/control/AndroidControlsProviderService.kt +++ b/app/src/main/java/li/klass/fhem/device/control/AndroidControlsProviderService.kt @@ -19,8 +19,8 @@ import li.klass.fhem.AndFHEMApplication import li.klass.fhem.R import li.klass.fhem.activities.AndFHEMMainActivity import li.klass.fhem.adapter.devices.core.detail.DeviceDetailRedirectFragmentArgs -import li.klass.fhem.adapter.devices.toggle.OnOffBehavior import li.klass.fhem.behavior.dim.DimmableBehavior +import li.klass.fhem.behavior.toggle.OnOffBehavior import li.klass.fhem.connection.backend.ConnectionService import li.klass.fhem.connection.backend.DummyServerSpec import li.klass.fhem.connection.backend.FHEMServerSpec diff --git a/app/src/main/java/li/klass/fhem/device/control/ControlContext.kt b/app/src/main/java/li/klass/fhem/device/control/ControlContext.kt index 1253c8c23..d51d8601e 100644 --- a/app/src/main/java/li/klass/fhem/device/control/ControlContext.kt +++ b/app/src/main/java/li/klass/fhem/device/control/ControlContext.kt @@ -1,5 +1,5 @@ package li.klass.fhem.device.control -import li.klass.fhem.adapter.devices.toggle.OnOffBehavior +import li.klass.fhem.behavior.toggle.OnOffBehavior data class ControlContext(val onOffBehavior: OnOffBehavior) \ No newline at end of file diff --git a/app/src/main/java/li/klass/fhem/devices/backend/ToggleableService.kt b/app/src/main/java/li/klass/fhem/devices/backend/ToggleableService.kt index 812baaf42..15d440aa8 100644 --- a/app/src/main/java/li/klass/fhem/devices/backend/ToggleableService.kt +++ b/app/src/main/java/li/klass/fhem/devices/backend/ToggleableService.kt @@ -24,7 +24,7 @@ package li.klass.fhem.devices.backend -import li.klass.fhem.adapter.devices.toggle.OnOffBehavior +import li.klass.fhem.behavior.toggle.OnOffBehavior import li.klass.fhem.domain.core.FhemDevice import org.slf4j.LoggerFactory import javax.inject.Inject diff --git a/app/src/main/java/li/klass/fhem/update/backend/group/GroupProvider.kt b/app/src/main/java/li/klass/fhem/update/backend/group/GroupProvider.kt index a887aa32d..8c324f12f 100644 --- a/app/src/main/java/li/klass/fhem/update/backend/group/GroupProvider.kt +++ b/app/src/main/java/li/klass/fhem/update/backend/group/GroupProvider.kt @@ -25,8 +25,8 @@ package li.klass.fhem.update.backend.group import android.content.Context -import li.klass.fhem.adapter.devices.toggle.OnOffBehavior import li.klass.fhem.behavior.dim.DimmableBehavior +import li.klass.fhem.behavior.toggle.OnOffBehavior import li.klass.fhem.domain.core.DeviceFunctionality import li.klass.fhem.domain.core.FhemDevice import li.klass.fhem.update.backend.device.configuration.DeviceConfigurationProvider diff --git a/app/src/test/java/li/klass/fhem/adapter/devices/toggle/OnOffBehaviorTest.kt b/app/src/test/java/li/klass/fhem/adapter/devices/toggle/OnOffBehaviorTest.kt index 945d3b3da..fd5d6317b 100644 --- a/app/src/test/java/li/klass/fhem/adapter/devices/toggle/OnOffBehaviorTest.kt +++ b/app/src/test/java/li/klass/fhem/adapter/devices/toggle/OnOffBehaviorTest.kt @@ -33,6 +33,7 @@ import io.mockk.impl.annotations.MockK import li.klass.fhem.adapter.devices.hook.ButtonHook import li.klass.fhem.adapter.devices.hook.ButtonHook.* import li.klass.fhem.adapter.devices.hook.DeviceHookProvider +import li.klass.fhem.behavior.toggle.OnOffBehavior import li.klass.fhem.domain.core.FhemDevice import li.klass.fhem.testutil.MockRule import li.klass.fhem.update.backend.device.configuration.DeviceConfiguration