BWilky / viewtimeout

Returns to default view after activity timeout
MIT License
14 stars 5 forks source link

Feature Request: A way to opt-in for specific views only #9

Closed jeremysherriff closed 2 months ago

jeremysherriff commented 9 months ago

My current problem: Currently, once installed and enabled, all cards return to the default view unless specifically overridden. If you wish to only return on timeout from only one or two views or sub-views, you must list all other views and set to false. When adding a new view, you must remember to add that view to the list and disable the timeout.

I would like a way to enable the view timeout for specific views only (opt-in rather than opt-out).

Proposal: Either of the following solutions would be acceptable, and would be reasonably intuitive. The below examples would enable timeout for the second-camera view only.

Option 1 - respect the main option default: false and let the user specify specific views under the views: key. (Currently, setting default: false does not influence behaviour at all) Eg:

view_timeout:
  timeout: true
  default: false
  duration: 15000
  views:
    second-camera: home

Option 2 - If the views: key is specified, then only those views are included in the timeout (i.e. same behaviour as the users: key). The default key becomes irrelevant. Eg:

view_timeout:
  timeout: true
  duration: 15000
  views:
    second-camera: home

Note that there is no need to set home: false once such an include-only configuration is implemented. In my opinion, Option 1 is the better option and should be easy to implement without disrupting existing configurations.

bonstio commented 2 months ago

See https://github.com/BWilky/viewtimeout/pull/13