Skip to content

Commit

Permalink
Update name
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwohlbruck committed May 1, 2022
1 parent 61acaf1 commit 7aa0b26
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
2 changes: 0 additions & 2 deletions client/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ Vue.use(VueNativeSock, wsUrl, {
reconnectionAttempts: 5,
reconnectionDelay: 3000,
passToStoreHandler: (eventName: string, event: any) => {
console.log(eventName, event)

if (!eventName.startsWith('SOCKET_')) return

switch (eventName) {
Expand Down
1 change: 0 additions & 1 deletion client/src/store/groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export const initialState = (): GroupsState => ({

const mutations = {
ADD_GROUP(state: GroupsState, group: Group) {
console.log(group)
Vue.set(state.byId, group._id, {
...state.byId[group._id],
...group,
Expand Down
15 changes: 5 additions & 10 deletions client/src/views/LampSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ v-container
div
h6.text-body-1 LED brightness level
v-slider(
v-model='config.brightnessLevel'
v-model='config.brightness'
discrete
min='.25'
max='1'
step='.01'
:label='Math.floor(config.brightnessLevel * 100) + "%"'
:label='Math.floor(config.brightness * 100) + "%"'
hide-details
)

Expand All @@ -53,14 +53,14 @@ v-container
div(v-show='config.nightMode')
h6.text-body-1 Minimum ambient light level (night mode)
v-slider(
v-model='config.nightModeSensitivity'
v-model='config.minimumLightLevel'
:disabled='!config.nightMode'
discrete
min='0'
max='1'
step='.1'
:tick-labels="['Pitch black', '', '', '', '', 'Dark', '', '', '', '', 'Dim']"
:label='config.nightModeSensitivity * 100 + "%"'
:label='config.minimumLightLevel * 100 + "%"'
)

//- Reading light color temp
Expand Down Expand Up @@ -111,12 +111,7 @@ export default class LampSettings extends Vue {
deleteLampDialog = false
name = ''
config: any = {
nightMode: true,
nightModeSensitivity: .5,
brightnessLevel: 1,
readingLightColorTemperature: 6000,
}
config: any = {}
async mounted() {
const lamp = await getLamp(this.$route.params.id)
Expand Down
1 change: 1 addition & 0 deletions server/routes/lamps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ router.post('/', isAuthenticated, async (req, res) => {

router.get('/:id/config', isAuthenticated, async (req, res) => {
const config = await getLampConfig(req.params.id)
// const config = {"deviceId":"4091519b56b8","readingLightColorTemperature":2001,"nightMode":false,"minimumLightLevel":0.8,"wifi":[{"ssid":"asu-visitor","password":""}],"brightness":0.5,"lampId":"626df507d6756882f166942c"}
return res.status(200).json(config)
})

Expand Down

0 comments on commit 7aa0b26

Please sign in to comment.