diff --git a/application/spotify.py b/application/spotify.py index f9eecf4..92d87b1 100644 --- a/application/spotify.py +++ b/application/spotify.py @@ -232,7 +232,7 @@ class Spotify(object): data = {} if uri: - if uri.startswith('spotify:track:'): + if uri.startswith('spotify:track:') or uri.startswith('spotify:episode:'): data = { "uris": [uri] } diff --git a/hardware/case/square/luniebox-back.scad b/hardware/case/square/luniebox-back.scad index 6534c4f..f9ab4e3 100644 --- a/hardware/case/square/luniebox-back.scad +++ b/hardware/case/square/luniebox-back.scad @@ -4,15 +4,6 @@ module luniebox_back() { difference() { union() { cube([length+depth,height+depth,depth]); - // screws RFID MC522 - translate([length/2-22,height*0.6-13.5,depth]) - screw(); - translate([length/2-22,height*0.6+13.5,depth]) - screw(); - translate([length/2+16.5,height*0.6-18,depth]) - screw(); - translate([length/2+16.5,height*0.6+18,depth]) - screw(); // clips translate([clip_space,0,0]) clip_screw(); @@ -35,11 +26,14 @@ module luniebox_back() { rotate([0,0,90]) clip_screw(); } - // USB port hole - translate([54+depth,14+depth,0]) - rounded_cube(s=[10,6,depth],r=1.5); - translate([38,20+depth,-render_limiter]) - cube([10,1.5,depth+render_limiter*2]); + // UPS hat hole + translate([length-12-50,18,-render_limiter]) + cube([45,6,depth+render_limiter*2]); + // light holes + translate([20,21,-render_limiter]) + screw_hole(depth); + translate([30,21,-render_limiter]) + screw_hole(depth); } } diff --git a/hardware/case/square/luniebox-back.stl b/hardware/case/square/luniebox-back.stl new file mode 100644 index 0000000..f49d845 Binary files /dev/null and b/hardware/case/square/luniebox-back.stl differ diff --git a/hardware/case/square/luniebox-bottom.scad b/hardware/case/square/luniebox-bottom.scad index f13bdb0..fa7f140 100644 --- a/hardware/case/square/luniebox-bottom.scad +++ b/hardware/case/square/luniebox-bottom.scad @@ -18,18 +18,23 @@ module luniebox_bottom() { rotate([0,0,90]) clip_screw(); // screws Raspi Zero - translate([length-10,5+depth,depth]) + translate([15,40+depth,depth]) screw(); - translate([length-68,5+depth,depth]) + translate([73,40+depth,depth]) screw(); - translate([length-10,28+depth,depth]) + translate([15,63+depth,depth]) screw(); - translate([length-68,28+depth,depth]) + translate([73,63+depth,depth]) screw(); + // screws UPS HAT + translate([15,5+depth,depth]) + screw(h=24); + translate([74,5+depth,depth]) + screw(h=24); // screws MCP - translate([length/2-7.5,width/2-7+depth,depth]) + translate([length/2-7.5,width/2+35-7+depth,depth]) screw(); - translate([length/2+7.5,width/2-7+depth,depth]) + translate([length/2+7.5,width/2+35-7+depth,depth]) screw(); } // clip holes @@ -37,9 +42,9 @@ module luniebox_bottom() { clip_hole(); translate([clip_length_space,depth+clip_d/2,0]) clip_hole(); - translate([clip_space,width-clip_d/2,0]) + translate([clip_space,width-clip_d/2 - front_offset,0]) clip_hole(); - translate([clip_length_space,width-clip_d/2,0]) + translate([clip_length_space,width-clip_d/2 - front_offset,0]) clip_hole(); } } diff --git a/hardware/case/square/luniebox-bottom.stl b/hardware/case/square/luniebox-bottom.stl new file mode 100644 index 0000000..fab9759 Binary files /dev/null and b/hardware/case/square/luniebox-bottom.stl differ diff --git a/hardware/case/square/luniebox-front-panel.scad b/hardware/case/square/luniebox-front-panel.scad new file mode 100644 index 0000000..3c2c065 --- /dev/null +++ b/hardware/case/square/luniebox-front-panel.scad @@ -0,0 +1,58 @@ +include + +module luniebox_front_panel() { + + grill_width=2; + + difference() { + union() { + cube([length+depth,height+depth,depth]); + } + // speaker hole middle + translate([length/2,height/2,-depth / 2]) + cylinder(d=103,h=depth*2); + } + for ( i = [grill_width*2 : grill_width*2 : 51.5] ) { + translate([length/2,height/2,depth/2]) + difference () { + cylinder (h = depth, r=i+grill_width/2, center = true); + cylinder (h = depth*2, r=i-grill_width/2, center = true); + } + } + + translate([length/2,height/2,0]) + rotate([0,0,-45]) + translate([-grill_width/2,grill_width*1.5,0]) + cube([grill_width,51.5,depth]); + + translate([length/2,height/2,0]) + rotate([0,0,45]) + translate([-grill_width/2,grill_width*1.5,0]) + cube([grill_width,51.5,depth]); + + translate([length/2,height/2,0]) + rotate([0,0,-135]) + translate([-grill_width/2,grill_width*1.5,0]) + cube([grill_width,51.5,depth]); + + translate([length/2,height/2,0]) + rotate([0,0,135]) + translate([-grill_width/2,grill_width*1.5,0]) + cube([grill_width,51.5,depth]); + + + // screws front + translate([5,5+depth,depth]) + screw(h=front_offset-depth); + translate([5,width-5+depth,depth]) + screw(h=front_offset-depth); + translate([length-5,5+depth,depth]) + screw(h=front_offset-depth); + translate([length-5,width-5+depth,depth]) + screw(h=front_offset-depth); +} + +luniebox_front_panel(); + + + diff --git a/hardware/case/square/luniebox-front.scad b/hardware/case/square/luniebox-front.scad index 1b011cb..0597e3c 100644 --- a/hardware/case/square/luniebox-front.scad +++ b/hardware/case/square/luniebox-front.scad @@ -4,24 +4,15 @@ module luniebox_front() { difference() { union() { cube([length+depth,height+depth,depth]); - // screws speaker right - translate([height/2-22.5,height/2-22.5,depth]) - screw(); - translate([height/2+22.5,height/2-22.5,depth]) - screw(); - translate([height/2-22.5,height/2+22.5,depth]) - screw(); - translate([height/2+22.5,height/2+22.5,depth]) - screw(); - // screws speaker left - translate([length-height/2-22.5,height/2-22.5,depth]) - screw(); - translate([length-height/2+22.5,height/2-22.5,depth]) - screw(); - translate([length-height/2-22.5,height/2+22.5,depth]) - screw(); - translate([length-height/2+22.5,height/2+22.5,depth]) - screw(); + // screws speaker middle + translate([length/2-40.5,height/2-40.5,depth]) + screw(d=10); + translate([length/2+40.5,height/2-40.5,depth]) + screw(d=10); + translate([length/2-40.5,height/2+40.5,depth]) + screw(d=10); + translate([length/2+40.5,height/2+40.5,depth]) + screw(d=10); // clips translate([clip_space,0,0]) clip_screw(); @@ -44,29 +35,27 @@ module luniebox_front() { rotate([0,0,90]) clip_screw(); } - // speaker hole right - translate([height/2,height/2,-depth / 2]) - cylinder(d=50,h=depth*2); - // speaker hole left - translate([length-height/2,height/2,-depth / 2]) - cylinder(d=50,h=depth * 2); - // screw holes speaker right - translate([height/2-22.5,height/2-22.5,depth]) + // speaker hole middle + translate([length/2,height/2,-depth / 2]) + cylinder(d=103,h=depth*2); + // screw holes speaker middle + translate([length/2-40.5,height/2-40.5,depth]) + screw_hole(depth,d=5); + translate([length/2+40.5,height/2-40.5,depth]) + screw_hole(depth,d=5); + translate([length/2-40.5,height/2+40.5,depth]) + screw_hole(depth,d=5); + translate([length/2+40.5,height/2+40.5,depth]) + screw_hole(depth,d=5); + + // screws holes front panel + translate([5,5+depth,depth]) screw_hole(depth); - translate([height/2+22.5,height/2-22.5,depth]) + translate([5,width-5+depth,depth]) screw_hole(depth); - translate([height/2-22.5,height/2+22.5,depth]) + translate([length-5,5+depth,depth]) screw_hole(depth); - translate([height/2+22.5,height/2+22.5,depth]) - screw_hole(depth); - // screw holes speaker left - translate([length-height/2-22.5,height/2-22.5,depth]) - screw_hole(depth); - translate([length-height/2+22.5,height/2-22.5,depth]) - screw_hole(depth); - translate([length-height/2-22.5,height/2+22.5,depth]) - screw_hole(depth); - translate([length-height/2+22.5,height/2+22.5,depth]) + translate([length-5,width-5+depth,depth]) screw_hole(depth); } } diff --git a/hardware/case/square/luniebox-front.stl b/hardware/case/square/luniebox-front.stl new file mode 100644 index 0000000..6d797e7 Binary files /dev/null and b/hardware/case/square/luniebox-front.stl differ diff --git a/hardware/case/square/luniebox-helper.scad b/hardware/case/square/luniebox-helper.scad index 15dd3f6..53571b0 100644 --- a/hardware/case/square/luniebox-helper.scad +++ b/hardware/case/square/luniebox-helper.scad @@ -4,12 +4,12 @@ $fs = 0.05; render_limiter = 0.001; depth = 2; -length = 100; -width = 100; -height = 100; +length = 120; +width = 120; +height = 120; - -clip_space=20; +front_offset=10+depth*2; +clip_space=30; clip_d=5; clip_h=6; clip_length_space=length - clip_space + depth; @@ -44,9 +44,9 @@ module clip(width=15) { cube([width +render_limiter * 2,depth + render_limiter * 2,depth + render_limiter * 2]); } -module screw_hole(depth=0,d=clip_d/2) { +module screw_hole(depth=0,d=clip_d/2,height=clip_h) { z= -depth - render_limiter; - h=7+depth; + h=height+depth+1; translate([0,0,z]) cylinder(d=d,h=h); } @@ -54,7 +54,7 @@ module screw_hole(depth=0,d=clip_d/2) { module screw(d=clip_d,h=clip_h) { difference() { cylinder(d=d,h=h); - screw_hole(d=d/2); + screw_hole(d=d/2,height=h); } } diff --git a/hardware/case/square/luniebox-side.scad b/hardware/case/square/luniebox-side.scad index f153a3c..64e7181 100644 --- a/hardware/case/square/luniebox-side.scad +++ b/hardware/case/square/luniebox-side.scad @@ -18,9 +18,9 @@ module luniebox_side() { translate([clip_d/2+depth,clip_height_space+depth,0]) clip_hole(); - translate([width-clip_d/2,clip_space+depth,0]) + translate([width-clip_d/2-front_offset,clip_space+depth,0]) clip_hole(); - translate([width-clip_d/2,clip_height_space+depth,0]) + translate([width-clip_d/2-front_offset,clip_height_space+depth,0]) clip_hole(); } diff --git a/hardware/case/square/luniebox-side.stl b/hardware/case/square/luniebox-side.stl new file mode 100644 index 0000000..4b95279 Binary files /dev/null and b/hardware/case/square/luniebox-side.stl differ diff --git a/hardware/case/square/luniebox-top.scad b/hardware/case/square/luniebox-top.scad index aeebac6..9f1d2b0 100644 --- a/hardware/case/square/luniebox-top.scad +++ b/hardware/case/square/luniebox-top.scad @@ -4,6 +4,15 @@ module luniebox_top() { difference() { union() { cube([length+depth,width+depth,depth]); + // screws RFID MC522 + translate([length/2-22,height*0.55-13.5,depth]) + screw(); + translate([length/2-22,height*0.55+13.5,depth]) + screw(); + translate([length/2+16.5,height*0.55-18,depth]) + screw(); + translate([length/2+16.5,height*0.55+18,depth]) + screw(); // clips translate([clip_h,clip_space,0]) rotate([0,0,90]) @@ -19,27 +28,20 @@ module luniebox_top() { clip_screw(); } // clip holes - translate([clip_space,depth+clip_d/2,0]) + translate([clip_space,depth+clip_d/2+front_offset,0]) clip_hole(); - translate([clip_length_space,depth+clip_d/2,0]) + translate([clip_length_space,depth+clip_d/2+front_offset,0]) clip_hole(); translate([clip_space,width-clip_d/2,0]) clip_hole(); translate([clip_length_space,width-clip_d/2,0]) clip_hole(); // right btn hole - translate([length/2-25+depth,(width+depth)/2,-depth/2]) - cylinder(d=30,h=depth*2); + translate([length/2-10+depth,(width+depth)/6+front_offset,-depth/2]) + cylinder(d=3,h=depth*2); // left button hole - translate([length/2+25+depth,(width+depth)/2,-depth/2]) - cylinder(d=30,h=depth*2); - // led holes - translate([length/2+depth,(width+depth)/2-16.666,-depth/2]) - cylinder(d=2,h=depth*2); - translate([length/2+depth,(width+depth)/2,-depth/2]) - cylinder(d=2,h=depth*2); - translate([length/2+depth,(width+depth)/2+16.666,-depth/2]) - cylinder(d=2,h=depth*2); + translate([length/2+10+depth,(width+depth)/6+front_offset,-depth/2]) + cylinder(d=3,h=depth*2); } } diff --git a/hardware/case/square/luniebox-top.stl b/hardware/case/square/luniebox-top.stl new file mode 100644 index 0000000..dfb1208 Binary files /dev/null and b/hardware/case/square/luniebox-top.stl differ diff --git a/hardware/case/square/luniebox.scad b/hardware/case/square/luniebox.scad index 4444dad..b992b80 100644 --- a/hardware/case/square/luniebox.scad +++ b/hardware/case/square/luniebox.scad @@ -1,6 +1,7 @@ include use use +use use use use @@ -9,10 +10,15 @@ color(c=[1,0.1,0.1]) luniebox_bottom(); color(c=[0.2,1,0.2]) -translate([0,width+depth,depth]) +translate([0,width+depth-front_offset,depth]) rotate([90,0,0]) luniebox_front(); +color(c=[0.2,1,0.9]) +translate([0,width+depth,depth]) +rotate([90,0,0]) +luniebox_front_panel(); + color(c=[0.3,0.3,1]) translate([-depth,0,0]) rotate([90,0,90]) diff --git a/hardware/case/square/luniebox.stl b/hardware/case/square/luniebox.stl new file mode 100644 index 0000000..84f3a48 Binary files /dev/null and b/hardware/case/square/luniebox.stl differ