Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.
/ alfred-coworker Public archive

Automatically check-in people on Cobot as they connect to the Unifi Wifi

lewagon/alfred-coworker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Some code put together to automatically check-in people on Cobot when connecting to the Unifi network.

Still a lot to refactor and extract from Rakefile... Sorry for that!

Available tasks

$ rake -T
rake cobot:check_in:create[membership_id]         # Check-in a member
rake cobot:check_in:create_for_connected_clients  # 'main' rake task to check-in all connected users
rake cobot:check_in:list                          # List all today's check-ins
rake cobot:invoice:list[membership_id]            # List invoices for a member
rake cobot:members                                # Print a list of all active Cobot members
rake cobot:plan:list                              # List plans for space
rake cobot:time_pass:create[membership_id]        # Create a dont_charge time pass for a member
rake cobot:time_pass:unused[membership_id]        # List unused time passes for a member
rake cobot:token                                  # Generate a new Cobot access token
rake dotenv                                       # Load environment settings from .env
rake redis:ping                                   # PING Redis
rake unifi:clients                                # Print a list of all clients currently connected
rake unifi:devices                                # Print a list of all devices (APs) currently connected
rake unifi:squatters                              # Detect squatters

Cron job

0,10,20,30,40,50 9-11,14-16 * * * cd /home/seb/deployment/current && /usr/local/opt/rbenv/shims/bundle exec rake cobot:check_in:create_for_connected_clients unifi:squatters >> /var/log/cron.log 2>&1

Environment

You need the following environment variables (in a .env file or directly in the environment):

UNIFI_USER
UNIFI_PASSWORD
COBOT_ACCESS_TOKEN

On the command line:

UNIFI_CONTROLLER_ADDRESS
COBOT_ACCOUNT
SLACK_INCOMING_WEBHOOK_URL

About

Automatically check-in people on Cobot as they connect to the Unifi Wifi

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published