{"id":246,"date":"2021-10-29T16:23:22","date_gmt":"2021-10-29T14:23:22","guid":{"rendered":"https:\/\/www.smartlux.com\/232keypro\/?p=246"},"modified":"2021-11-15T12:15:22","modified_gmt":"2021-11-15T11:15:22","slug":"version-0-9-0","status":"publish","type":"post","link":"https:\/\/www.smartlux.com\/232keypro\/version-0-9-0\/","title":{"rendered":"232key Pro version 0.9.0 released"},"content":{"rendered":"<p><strong>This version introduces two new variables which are made available to your script.<\/strong> When 232key Pro receives data from the connected device, it tries to <a href=\"https:\/\/www.smartlux.com\/232keypro\/documentation\/#regex\">match a regular expression<\/a>. The string matched by the first capturing group is <a href=\"https:\/\/www.smartlux.com\/232keypro\/documentation\/scripts\/#variables\">stored in a variable named <strong>value<\/strong><\/a>.<\/p>\n<h2>The following additional variables were introduced in this version:<\/h2>\n<ul>\n<li><strong>valueDouble<\/strong>: contains the <strong>value<\/strong> string converted to a <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.double\">Double<\/a> or null if no conversion was possible.<\/li>\n<li><strong>valueDecimal<\/strong>: contains the <strong>value<\/strong> string converted to a <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.decimal\">Decimal<\/a> or null if no conversion was possible.<\/li>\n<\/ul>\n<h2>Example<\/h2>\n<p>Data received from the scale:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-250\" src=\"https:\/\/www.smartlux.com\/232keypro\/wp-content\/uploads\/sites\/5\/2021\/11\/mt-sics-request-weight.png\" alt=\"Requesting the weight from a scale with the MT-SICS &quot;SI&quot; command\" width=\"603\" height=\"706\" srcset=\"https:\/\/www.smartlux.com\/232keypro\/wp-content\/uploads\/sites\/5\/2021\/11\/mt-sics-request-weight.png 603w, https:\/\/www.smartlux.com\/232keypro\/wp-content\/uploads\/sites\/5\/2021\/11\/mt-sics-request-weight-256x300.png 256w\" sizes=\"auto, (max-width: 603px) 100vw, 603px\" \/><\/p>\n<pre>S S      5.000 kg&lt;13&gt;&lt;10&gt;<\/pre>\n<p>Captured in <strong>value<\/strong> string:<\/p>\n<pre>      5.000<\/pre>\n<p>Script to output the weight only if it is greater than 0.1 kg:<\/p>\n<pre>if (valueDecimal&gt;0.1m) return valueDecimal.ToString();<\/pre>\n<p>Output (note: <strong>valueDecimal<\/strong> preserves any trailing zeros, <strong>valueDouble<\/strong> does not):<\/p>\n<pre>5.000<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This version introduces two new variables which are made available to your script. When 232key Pro receives data from the connected device, it tries to match a regular expression. The string matched by the first capturing group is stored in a variable named value. The following additional variables were introduced in this version: valueDouble: contains &hellip; <a href=\"https:\/\/www.smartlux.com\/232keypro\/version-0-9-0\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">232key Pro version 0.9.0 released<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","_seopress_robots_follow":"","_seopress_robots_imageindex":"","_seopress_robots_snippet":"","_seopress_robots_primary_cat":"none","_seopress_robots_breadcrumbs":"","_seopress_robots_freeze_modified_date":"","_seopress_robots_custom_modified_date":"","_seopress_robots_canonical":"","_seopress_social_fb_title":"","_seopress_social_fb_desc":"","_seopress_social_fb_img":"","_seopress_social_fb_img_attachment_id":0,"_seopress_social_fb_img_width":0,"_seopress_social_fb_img_height":0,"_seopress_social_twitter_title":"","_seopress_social_twitter_desc":"","_seopress_social_twitter_img":"","_seopress_social_twitter_img_attachment_id":0,"_seopress_social_twitter_img_width":0,"_seopress_social_twitter_img_height":0,"_seopress_redirections_value":"","_seopress_redirections_enabled":"","_seopress_redirections_enabled_regex":"","_seopress_redirections_logged_status":"","_seopress_redirections_param":"","_seopress_redirections_type":301,"_seopress_analysis_target_kw":"","_seopress_news_disabled":"","_seopress_video_disabled":"","_seopress_video":[],"_seopress_pro_schemas_manual":[{"_seopress_pro_rich_snippets_type":"none"}],"_seopress_pro_rich_snippets_disable_all":"","_seopress_pro_rich_snippets_disable":[],"_seopress_pro_schemas":[],"footnotes":""},"categories":[5],"tags":[],"class_list":["post-246","post","type-post","status-publish","format-standard","hentry","category-changelog"],"_links":{"self":[{"href":"https:\/\/www.smartlux.com\/232keypro\/wp-json\/wp\/v2\/posts\/246","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.smartlux.com\/232keypro\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.smartlux.com\/232keypro\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.smartlux.com\/232keypro\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.smartlux.com\/232keypro\/wp-json\/wp\/v2\/comments?post=246"}],"version-history":[{"count":4,"href":"https:\/\/www.smartlux.com\/232keypro\/wp-json\/wp\/v2\/posts\/246\/revisions"}],"predecessor-version":[{"id":253,"href":"https:\/\/www.smartlux.com\/232keypro\/wp-json\/wp\/v2\/posts\/246\/revisions\/253"}],"wp:attachment":[{"href":"https:\/\/www.smartlux.com\/232keypro\/wp-json\/wp\/v2\/media?parent=246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.smartlux.com\/232keypro\/wp-json\/wp\/v2\/categories?post=246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.smartlux.com\/232keypro\/wp-json\/wp\/v2\/tags?post=246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}