↔️ Swipe Navigation

Hello,

Some news, after adding the resource it now works

Thank you

which resource?

/hacsfiles/lovelace-swipe-navigation/swipe-navigation.js

now the integration disapperaed from my HACS, is nowhere ???

This isn’t an integration, it’s under frontend and HACS should automatically add the resource for you. If it doesn’t you can try to reinstall it from HACS.

Awesome! Thank you very much! This needs to be a core function.

I have already made a PR about this being broken in 0.117

You made an “issue”, had me excited that you fixed something for a second there. PRs are “pull requests”, means you’ve changed or added something to the code that you’d like pulled into the main project. Also, 0.117.0b0 is currently broken itself, so you might want to hold off on updating.

Haha woops sorry :rofl:

This will definitely be broken in 0.117 until I get a fix in. It’s my fault, my compact header PR to HA breaks this. Will keep you updated.

I installed this plugin, but i’m doing something wrong.

I have this items in resources tab in configuration:
/hacsfiles/lovelace-swipe-navigation/swipe-navigation.js in url field and JavaScript Module in resource type field

in edit dashboard -> raw configuration editor this is my top rows:

swipe_nav:
  wrap: false
  animate: swipe
  skip_tabs: '5,6,7,8'
  prevent_default: true
  swipe_amount: 30
title: ''
views:
  - badges:
      - entity: weather.home
.....rest of the lovalace file

but swipe navigation is not working.

i’m on beta 0.117.0b1 i never tried it on previous builds.

Thanks

Read the one post above yours

definitely i need glasses :slight_smile:

Hello,

So because this isn’t available in HACS (why?), I copied the .js file to www/community/lovelace-swipe-navigation/
added the js module to resources,
put the config in my dashboard
and rebooted HA

Nothing.

I am on supervisor OS 4.15 and HA 0.116.4

I do have 2 dashboards so I put the config in both.
Is this supposed to work in my set up?

Yes it is, in the frontend section.

Mind sharing that?

Not necessary.

This currently works fine on 0.116, but not on 0.117 yet.

Yup, if you want anything other than the default config you need it in all dashboards.

Yes.

Do you get any errors in HA or in your browser’s dev tools?

Also, if you followed the manual installation instructions, you’ve saved the js file to the wrong location:

Might need to refresh/clear cache as well, depending.

Yes it is, in the frontend section.

In HACS frontend I put “swipe” into the search and it came up with nothing found.
I then searched the whole frontend lovelace and themes and still didn’t find it.

My config is the same as your example:
swipe_nav:
wrap: false
animate: swipe
skip_tabs: 5,6,7,8
prevent_default: true
swipe_amount: 30

It is above everything else in both of my dashboards as that is what I thought you meant by “root of your love lace configuration”

I do have an error:

Logger: custom_components.hacs.web.category
Source: custom_components/hacs/webresponses/category.py:31
Integration: HACS (documentation, issues)
First occurred: 18:37:34 (2 occurrences)
Last logged: 18:38:09
Tried to serve up ‘/config/www/community/lovelace–swipe-navigation/swipe-navigation.js’ but it does not exist

Ok so it should be in www/lovelace-swipe-navigation/? not www/community/ as all the others?

I have just put it there, change the path in resources, and rebooted HA - I now get no errors in the log but it still it doesn’t work.

I have done a refresh and even rebooted my phone.

I don’t know if this is relevant but I use card-mod to replicate your CH header stuff in my themes.
What else am I doing wrong?

You can put it anywhere you want in the www folder, but the resource needs to point to the right place. So if you put the file in /www/community/lovelace–swipe-navigation/swipe-navigation.js manually or installed with HACS then the resource url needs to be /hacsfiles/lovelace-swipe-navigation/swipe-navigation.js because that is the directory for things installed with HACS (the resource URL looks like it points to a different place as that’s a feature of HACS to help with caching).

If instead you follow the manual installation instructions (as explained in the readme): you put the file in /www/lovelace-swipe-navigation/swipe-navigation.js then your resource url would be /local/lovelace-swipe-navigation/swipe-navigation.js?v=1.0.0 and you would need to increase the version number manually each time you update. Essentially, if you install things manually the resource URL will point to where you put the file, only www is replaced with local and if you install with HACS then www is replaced with hacsfiles.

Don’t use the example config posted, it won’t fit your needs. It is just an example, you should build your own config using the options in the config section of the readme or just don’t add the config at all and it will use the default values.

Since you’re not using a codeblock when posting your config, I can’t tell if there are any indentation errors or not. This is what it should look like at the top of your lovelace raw config (again, this is an example. don’t use this config):

swipe_nav:
  wrap: false
  animate: swipe
  skip_tabs: 5,6,7,8
  prevent_default: true
  swipe_amount: 30

So this is my config:

swipe_nav:
  wrap: false
  animate: swipe
  prevent_default: true
  swipe_amount: 30

Because I cannot find your “swipe-navigation” in the HACS frontend section by searching or browsing ( you think I should be able to do that?), I copied the .js file to /config/www/community/lovelace-swipe-navigation/, but that threw up errors as you previously asked if it did.
My resource URL was /hacsfiles/lovelace-swipe-navigation/swipe-navigation.js

So I changed it to /config/www/lovelace-swipe-navigation/ and changed the resource URL to
/local/lovelace–swipe-navigation/swipe-navigation.js

Now I don’t get errors in the log.

But it doesn’t work as I expect. I cannot swipe left or right on my phone browsr to change views.

Did you press the orange plus sign in bottom right corner before searching? It is definitely in there.

1 Like