Skip to content

Commit

Permalink
Put behaviors together
Browse files Browse the repository at this point in the history
  • Loading branch information
klassm committed Nov 21, 2021
1 parent 26caaf6 commit 5fc2259
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5fc2259

Please sign in to comment.