Learn R Programming

PhilipsHue (version 1.0.0)

auth_helpers: Authentication helpers

Description

These functions help manage the environment variables that the PhilipsHue package uses to store authentication secrets.

Usage

has_local_auth()

write_auth(path = ".Renviron", append = TRUE)

reset_auth()

Arguments

path

file path to write secrets to

append

passed to write()

Value

has_local_auth() returns a logical value; write_auth() and reset_auth() return TRUE invisibly upon success.

Details

Local authentication requires setting two environment variables: PHILIPS_HUE_BRIDGE_IP and PHILIPS_HUE_BRIDGE_USERNAME. has_local_auth() uses regular expressions to check if these variables are set (but does not check if the credentials actually work). reset_auth() sets these variables to empty strings, and write_auth() writes the current values to a file (e.g. an .Renviron file for use during development).