GithubHelp home page GithubHelp logo

davidlb / files Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tarheelgrad1998/files

0.0 1.0 0.0 13 KB

Custom Component for Home Assistant that reads a list of files from a directory into a sensor. Pre requisite for the Gallery Card.

Python 100.00%

files's Introduction

Files Component

Custom Component for Home Assistant that reads a list of files from a directory into a sensor.

This was developed for use alongside the Gallery Card but may have other uses.

Installation

hacs_badge

Files must be in the WWW folder, ideally in a subfolder. This component will periodically scan the folder for changes to the files, and is based on the built-in Folder component.

The component can be installed from HACS, but follow the below instructions to install manually.

  1. Create a folder in your config directory named custom_components
  2. Create a folder in your custom_components named files
  3. Copy the 3 files (init.py, manifest.json, and sensor.py) into the files folder
  4. Create a folder in your WWW folder named images (or any other name, but be sure to use the proper name below)
  5. Add your images/videos to this folder
  6. Add the files sensor to your configuration.yaml file
    - sensor
        - platform: files
          folder: /config/www/images
          filter: '**/*.jpg'
          name: gallery_images
          sort: date
          recursive: True
  7. Restart Home Assistant
  8. Check the sensor.gallery_images entity to see if the fileList attribute lists your files

Configuration Variables

Name Type Default Description
platform string Required files
folder string Required Folder to scan, must be /config/www/***
name string Required The entity ID for the sensor
sort string Optional One of 'name', 'date', or 'size'; Determines how files are sorted in the Gallery, Default: date
recursive boolean Optional True or False; If True, the pattern filter ** will match any files and zero or more directories, subdirectories and symbolic links to directories. Note: Using the ** pattern in large directory trees may consume an inordinate amount of time , Default: False

Credits

This component largely created from work done by @zsarnett in the slideshow card, from which other inspiration was also taken.

files's People

Contributors

tarheelgrad1998 avatar davidlb avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.